Scheduled Tasks

G

Gordon

Help. I've used Scheduled Tasks in Windows2000 before,
mainly to run Visual Basic programs. Now I've created
a .bat file that is supposed to stop an application. The
code inside the .bat file is:

%WINDIR%\System32\tskill.exe outlook

When I run this manually by double clicking the file, it
runs perfectly. However, when I set it up to run as a
scheduled task, it doesn't work. It appears that the task
ran successfully, and the result says 0x0. But the
application doesn't stop.

How can I get this to work in Scheduled Tasks?

Thanks in adv.
Gordon
 
E

EEC1 [MSFT]

When I try this, tskill will terminate the application when called via Task
Scheduler.

What Service Pack version are you running?

Maybe it has something to do with the user account you're running the script
under?

You also might try spawning a new cmd.exe and then running your script. For
example:
start "" cmd.exe /c <full path to your script here>

--

Thanks,
Mike

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
 
P

Pegasus \(MVP\)

Gordon said:
Help. I've used Scheduled Tasks in Windows2000 before,
mainly to run Visual Basic programs. Now I've created
a .bat file that is supposed to stop an application. The
code inside the .bat file is:

%WINDIR%\System32\tskill.exe outlook

When I run this manually by double clicking the file, it
runs perfectly. However, when I set it up to run as a
scheduled task, it doesn't work. It appears that the task
ran successfully, and the result says 0x0. But the
application doesn't stop.

How can I get this to work in Scheduled Tasks?

Thanks in adv.
Gordon

Add some simple diagnostics, then examine the log files:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
%WINDIR%\System32\tskill.exe outlook 1>>c:\test.log 2>c:\test.err
echo %date% %time% End of task >> c:\test.log
 

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