Re: Scheduling the running of a batch file

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: David H. Lipman (DLipman~nospam~_at_Verizon.Net)
Date: 02/08/05


Date: Tue, 8 Feb 2005 12:58:50 -0500

If it is a batch file, try calling the batch file this way...

%comspec% /c <path>\MyBatchFile.BAT

-- 
Dave
"John Steen" <moderndads(nospam)@hotmail.com> wrote in message
news:AE15C9E9-0180-4DD8-A95F-759C35B94E40@microsoft.com...
| I did as you suggested, Dave, but no go.  The application still won't run.
| Thanks for your help, though.
|
| John
|
| "David H. Lipman" wrote:
|
| > Study the concept of Redirection of Input and Output.
| >
| > In a command prompt, it I type;  echo Dave
| >
| > The word Dave is shown on the screen
| >
| > it I type;  echo Dave >c:\myfile
| >
| > The file "c:\myfile" would be created with the word Dave.
| >
| > it I type;  echo Dave >>c:\myfile
| >
| > The file "c:\myfile" would be appended with the word Dave.
| >
| > Those are samples of Redirection of Output.
| >
| > If you have a program that requires the response "Y" five time, you can create a file
such
| > as"c:\myfile" with the following contents
| >
| > c:\myfile
| > -----------
| > y
| > y
| > y
| > y
| > y
| >
| >
| >
| > I can then call my application (FOO.EXE) such that it uses the information in C:\MYFILE
with
| > the command...
| >
| > foo <c:\myfile
| >
| > Now FOO.EXE will obtain its responses from c:\myfile
| >
| > Of course, FOO.EXE has to be written to use Redirection of Input and Output.  Most are,
but
| > not all.
| >
| > -- 
| > Dave
| >
| >
| >
| >
| > "John Steen" <moderndads(nospam)@hotmail.com> wrote in message
| > news:C204EF54-0D59-403E-B1A3-570006E6EA28@microsoft.com...
| > | I checked, and the task runs under the administrar user, so rights aren't an
| > | issue.
| > |
| > | How do I redirect input from an answers file?
| > |
| > | Thanks,
| > | John
| > |
| > | "David H. Lipman" wrote:
| > |
| > | > You have to apply a user and password with sufficient rights to the job for the job
to
| > | > execute.  If the application requires input redirect its input from an answer file.
| > | >
| > | > -- 
| > | > Dave
| > | >
| > | >
| > | >
| > | >
| > | > "John Steen" <moderndads(nospam)@hotmail.com> wrote in message
| > | > news:75CA9230-36A5-4C40-B613-E6905DE296FB@microsoft.com...
| > | > | Setup:
| > | > |
| > | > | - Windows 2000 Server
| > | > | - MS SQL2000
| > | > |
| > | > | I have a VB6 application that modifies a SQL database that, when launched,
| > | > | prompts the user to enter one of three parameters and press OK:
| > | > |
| > | > | X (cancels the application)
| > | > |
| > | > | ALL (modifies all records in the DB that have a null value in a particular
| > | > | column, changing the null value in that column to a non-null value)
| > | > |
| > | > | <Registrant ID> (runs the application against the records with the above
| > | > | parameters, but only for one particular registrant)
| > | > |
| > | > | The application runs fine when it's launched manually.  I specify the ALL
| > | > | option, click OK and it's done.  It also runs fine when a batch file
| > | > | containing the application name and option (application.exe ALL) is launched
| > | > | from a command prompt.  But when I create a scheduled task calling the batch
| > | > | file at a particular time, the application fails to run at all.
| > | > |
| > | > | There is no indication of an error in Scheduled Tasks or Event Viewer, and
| > | > | the status in Scheduled Tasks shows successful.  But the records in the DB
| > | > | are not modified, and the result window that appears when the application is
| > | > | finished does not appear.
| > | > |
| > | > | Any idea why this is happening?  I have other batch files that run fine as
| > | > | scheduled tasks.  Is there something about VB applications that prevent them
| > | > | from running this way?
| > | > |
| > | > | Thanks!
| > | > |
| > | > | John Steen
| > | > |
| > | >
| > | >
| > | >
| >
| >
| >


Relevant Pages

  • Re: OT - Those *#&#%$^& Drivers With Cellphones
    ... reported the theft of your gun as the law requires. ... Blaming me for their crime? ... You don't have to accept it Dave and the state won't care at all. ... And what stops them from changing the test whenever they want, John? ...
    (rec.crafts.metalworking)
  • Re: Doctor Who Apologist
    ... As such I wonder if Dave gives any of the following atheist ... film director`s John Carpenter and David Cronenberg ... Julian and Sandy? ... Now you're censoring INDIVIDUAL LETTERS? ...
    (uk.media.tv.sf.drwho)
  • Re: OT: Wednesday funny
    ... If Laura, Kate and Sarah go out for lunch, they will call each other ... When the bill arrives, Mike, Dave and John will each throw in $20, even ...
    (rec.food.cooking)
  • Re: Scheduling the running of a batch file
    ... "John Steen" wrote in message ... | Dave, just wanted you to know that I got the task working. ... | parameter from the batch file, and then ran the batch file from a command ... |> Study the concept of Redirection of Input and Output. ...
    (microsoft.public.win2000.general)
  • Re: spot the difference
    ... If Laura, Kate and Sarah go out for lunch, they will call each other ... If Mike, Dave and John go out, they will affectionately refer to each ...
    (uk.rec.humour)