Using "start" in a batch file with Scheduler

A

Ariel

Hello,

I seem to be having trouble using "start" in a batch file
to trigger a process when that batch file is envoked by
the Scheudler. If I run the batch outside of the
scheduler, no problems. When I run the batch via the
scheduler...no luck. Has anyone else experienced this and
if so, any insights on how to address this?

Thanks for any input.
 
M

Michael Bednarek

Hello,

I seem to be having trouble using "start" in a batch file
to trigger a process when that batch file is envoked by
the Scheudler. If I run the batch outside of the
scheduler, no problems. When I run the batch via the
scheduler...no luck. Has anyone else experienced this and
if so, any insights on how to address this?

What does the batch file do? Access network resources? Post the code.
 
A

Ariel

Thanks for the response Michael

I'm forced to use start because envoking the dcmctl
command will not exit to the next line in the batch:

I actually need to use it in a few batch files...here are
a couple"

EX 1:

start E:\ora9ias\dcm\bin\dcmctl stop -co OC4J_wf_devl
c:\schedule\sleep 59
E:\workflow\devl\bin\stopvis

EX 2:

start e:\workflow\devl\bin\export.cmd wfroot XXXXX
develexport.xml
c:\schedule\sleep 900
for /f "tokens=1-3 delims=/ " %%a in ('doff mmddyy ') do (
set mm=%%a
set dd=%%b
set yy=%%c)
rename develexport.xml %mm%%dd%%yy%-devel-export.xml
move e:\workflow\devl\bin\*xport.xml
e:\workflow\devl\bin\exports
c:
cd\
exit

Thanks for your help.
 
M

Michael Bednarek

Is E: a network drive? If so, make sure the scheduler runs this job
under a user account which has network access. Then map drive E:
within that batch file like:
NET USE E: \\server\share password /USER:domain\joedoe
or replace references to E: with the equivalent UNC.

Good luck.
 
A

Ariel

I'm afraid not. E: is a local drive.
-----Original Message-----
Is E: a network drive? If so, make sure the scheduler runs this job
under a user account which has network access. Then map drive E:
within that batch file like:
NET USE E: \\server\share password /USER:domain\joedoe
or replace references to E: with the equivalent UNC.

Good luck.

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"



.
 
R

Ritchie

Ariel said:
I seem to be having trouble using "start" in a batch file
to trigger a process when that batch file is envoked by
the Scheudler. If I run the batch outside of the

How are you scheduling the task? With the AT command, the GUI
Task Scheduler or something else?
 
M

Michael Bednarek

I'm afraid not. E: is a local drive.

What's the current directory when you run the batch file from the
command line? What did you specify in the scheduled task's "Start in:"
field?

Are you logged in when the task runs? What happens if you right-click
the task and select "Run"? What does the Task Log file (SchedLgU.Txt)
tell you?

Which version of NT (5.0, 5.1, 5.2) are you running? Under which
account is the task running? Does that account have a password which
complies with your system's password policies (non-blank, minimum
length)? Even if it does, I found that a blank password, which is
allowed on my home box, will not work with scheduled tasks.
 
A

Ariel

Below...
-----Original Message-----


What's the current directory when you run the batch file from the
command line?

When testing the batch manually, I'm runnig it out of my
profile directory....c:\documents and settings\username

This works fine.

What did you specify in the scheduled task's "Start in:"

The default of c:\scedule
Are you logged in when the task runs? What happens if you right-click
the task and select "Run"?

After testing that I can run the batch manually
successfully. I kick off the scheduled task and monitor
the events that should happen. These events do not happen
and the scheduler shows the jobs as "running". I have to
stop them manually or the will run forever.


What does the Task Log file (SchedLgU.Txt)
tell you?

Which version of NT (5.0, 5.1, 5.2) are you running?

W2K SP3

Under which
account is the task running?

I am using an acount with local admin privs. Everything
the batch is local to the machine, no network connectivity
is required. (I'm simply stopping and starting processes).

Does that account have a password which
complies with your system's password policies (non-blank, minimum
length)?

Yes

Even if it does, I found that a blank password, which is
allowed on my home box, will not work with scheduled
tasks.

I am using a valid password.

As a side note, I did try using "call" which also works
manually but still does not work when run in the scheduled
task...exhibts the same behavior.

Thanks for your persistance in looking at this.

Ariel
 
A

Ariel

Hello,

Well, I gave it a go using soon.exe to kick the job (BTW,
there is a bug in soon.exe where you need to set the local
delay to 60 (sec) and specify a time no less than 60 sec.
in W2k).

This created the job, it appeared in the GUI scheduler.
It has the same results, not stopping\starting a process,
and is "hung" with a status of "running". Is start only
usable in the console?

Argh!
Thanks again.

Ariel
 
R

Ritchie

Ariel said:
Hello,

Well, I gave it a go using soon.exe to kick the job (BTW,
there is a bug in soon.exe where you need to set the local
delay to 60 (sec) and specify a time no less than 60 sec.
in W2k).
http://support.microsoft.com/default.aspx?scid=kb;en-us;237840

This created the job, it appeared in the GUI scheduler.
It has the same results, not stopping\starting a process,
and is "hung" with a status of "running". Is start only
usable in the console?

No, it works fine for me. If you haven't already done so, try
scheduling the job with the AT command using the /i (interactive)
switch. Do you only have this issue when using 'dcmctl'?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top