Question

I am having trouble running batch files on Windows 7 that I created, and which run properly as Scheduled Tasks, on XP. When I run these batch files as Scheduled Tasks on Windows 7, the command window just closes quickly. The batch files actually consist of a wrapper that initiates another batch file that contains branching and call Python scripts - so it's a little complicated.

I'm comparing differences between my Windows 7 and XP machines. When I run these batch files on XP, the top bar in the command window says C:\WINDOWS\SYSTEM32\SVCHOST.EXE. I set up a simple batch file (that doesn't contain a wrapper, branching or Python scripts) on the Windows 7 computer and at the top it says taskeng.exe, please see capture below.

Example of simple batch file display on Windows 7.

Does anyone have a suggestion on what I need to do to get the batch files running on Windows 7 as scheduled tasks? Maybe there's something missing from my Environment Variables? I have checked the paths and everything in my more complicated batch files that I transferred to Windows 7 - I should say I can get the batch files running when I actually navigate to folder containing batch files I created. I really need them to run as Scheduled Tasks. I'm not particularly savvy with batch files, but these were running really well for 1+ year on my XP computer. Thank you! Patty

Was it helpful?

Solution

On Windows 7 when creating a a Scheduled Task you can choose 'Start In' you can then change the location in which it is run (and the directory to file you are refering to within your batch file.) This is worth trying before checking other things.

Second I would check what permissions it is being run with on Task Scheduler, run it as administrator to rule this out.

I would also see what happens when you just double click on the batch file as a logged in user and go forward from that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top