Re: Calling a batch file from IE using asp and vbscript

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 12/29/04


Date: Wed, 29 Dec 2004 18:04:40 -0500

Does your batch file call any code that raises a prompt or other kind of
visible GUI? Have you looked at http://www.aspfaq.com/2059 ?

I don't know if I can explain the scheduled task process better without
actually building it. That's on my to do list...

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"Mark C." <MarkC@discussions.microsoft.com> wrote in message
news:7413D8EC-576A-4D01-BE3F-5DB096A89BA4@microsoft.com...
> Aaron,
>
> Thanks very much for your response.  Unfortunately, I had already tried
> using Windows Integrated Authentication while using a privileged account
and
> I tried changing the account from IUSR_MachineName to a privileged network
> account and neither option worked.  The app seems to run, the batch file
is
> created, but it fails to run.  As a workaround I have been using a
scheduled
> task to run the file at the top of every hour but now a different sort of
> security concern having to do w/ our portal software renders my scheduled
> task obsolete.  Could you be kind enough to elaborate on your solution w/
the
> database/queue and the scheduled task.  I'm not quite sure that I
understand
> what you're getting at.  Thanks again.
>
> "Aaron [SQL Server MVP]" wrote:
>
> > The problem is that IIS runs ASP pages by default in the context of
> > IUSR_machineName, a very low-level user with few privileges and
virtually no
> > system access.
> >
> > You need to either set the IIS application to run in the context of a
> > privileged user, change the application to run as windows authenticated
and
> > not anonymous (and then authenticate as a privileged user), or add
> > IUSR_machineName to a group with enough privileges to execute the batch
> > file.
> >
> > Of course, each of these options can potentially become a security hole
> > without proper precautions.
> >
> > So, what I tend to recommend in cases like this is to add the requested
task
> > to a queue (e.g. in a database), and have a scheduled task wake up and
pick
> > up new tasks from the queue.  Then you don't have to worry about the
> > privileges you're exposing directly to your web page, and you can easily
set
> > the job to run in the context of any user you like and on any schedule
you
> > like...
> >
> > -- 
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "Mark C." <MarkC@discussions.microsoft.com> wrote in message
> > news:73A73B56-C105-4B6C-98F5-E0C6B509AA38@microsoft.com...
> > > I'm trying to call a batch file that I've built using the
FileSystemObject
> > > and CreateObject("Wscript.Shell"), oShell.Run... in an asp script.
> > > Naturally, I can get the script to work from a command line but not
from a
> > > browser.  The page does not throw an error but the oShell.Run...
portion
> > of
> > > the script doesn't run.  Any help would be appreciated.  Thanks.
> >
> >
> >


Relevant Pages

  • Re: Schedule Batch File-How to?
    ... backup with your Robobkup program. ... Panel> Scheduled Task etc. and the batch file name was used as the ... Windows command that you are using within the batch file. ... The properties window for the new scheduled task should now be open. ...
    (microsoft.public.windowsxp.general)
  • Re: Schedule Batch File-How to?
    ... Windows command that you are using within the batch file. ... you will not be using the batch file anymore. ... This window will also display your computer name and your user login name. ... The properties window for the new scheduled task should now be open. ...
    (microsoft.public.windowsxp.general)
  • Re: SEPKILL /im SMC.EXE /f
    ... ::Save the following as a batch file and execute it. ... can't reproduce on my test systems or requires administrator privileges ...
    (Bugtraq)
  • Re: Scheduled Task - Move Command
    ... scheduled task and it works. ... >> I have a batch file on a server that runs a backup then ... >> The backup portion runs fine but the move command fails. ...
    (microsoft.public.win2000.general)
  • Re: Cant run scheduled task
    ... down to bare bones using a different batch file that does next to nothing ... Log in as the service account I want to use. ... Log in as myself in one window and as the service ... myself OR let the scheduled task run on schedule with no one logged on. ...
    (microsoft.public.windows.server.general)