A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Security and Administration with Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Using Windows "scheduled tasks" to launch a .bat file



 
 
Thread Tools Display Modes
  #1  
Old February 18th 08, 06:37 PM posted to microsoft.public.windowsxp.security_admin
Dave Calkins
external usenet poster
 
Posts: 2
Default Using Windows "scheduled tasks" to launch a .bat file

I have a .bat file which I'd like to have run automatically every night.

I tried using Windows "scheduled tasks" and referenced the .bat file. I then
tried manually running it to test it. A command window briefly flashes on
the screen but the .bat file does not appear to be invoked.

I verified that the .bat file isn't getting called by creating a simple test
..bat file which did nothing more than create a file on disk. Sure enough the
..bat file isn't getting called. The test .bat file contents are shown below.


echo hello c:\test_log.txt


I also tried referencing cmd.exe /c "c:\test.bat" in the scheduled task and
this didn't work either.

The annoying part about all this is that I successfully did this a long time
ago and I recall having similar issues and eventually figuring it out If
only I could recall what the magic was which made it work.

Any ideas?




Ads
  #2  
Old February 19th 08, 05:33 AM posted to microsoft.public.windowsxp.security_admin
Dave Calkins
external usenet poster
 
Posts: 2
Default Using Windows "scheduled tasks" to launch a .bat file

I found the problem. Someone else suggested using cmd.exe /k "the .bat
file" so that the window would stay open, allowing viewing of any errors.

As it turns out, the problem was caused by one of the directories in the
path to the .bat file containing spaces. Using dir /x to obtain the 8.3
abbreviated name and using that instead fixed the problem.


"Dave Calkins" wrote in message
...
I have a .bat file which I'd like to have run automatically every night.

I tried using Windows "scheduled tasks" and referenced the .bat file. I
then tried manually running it to test it. A command window briefly
flashes on the screen but the .bat file does not appear to be invoked.

I verified that the .bat file isn't getting called by creating a simple
test .bat file which did nothing more than create a file on disk. Sure
enough the .bat file isn't getting called. The test .bat file contents are
shown below.


echo hello c:\test_log.txt


I also tried referencing cmd.exe /c "c:\test.bat" in the scheduled task
and this didn't work either.

The annoying part about all this is that I successfully did this a long
time ago and I recall having similar issues and eventually figuring it out
If only I could recall what the magic was which made it work.

Any ideas?





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 09:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.