hlking
asked on
Running bat file as scheduled task doesn't work in Vista
I am going crazy trying to sort out this issue. I have a bat file that maps two network drives and then executes a vbs file (contents in code section). It runs correctly from the command line but as a scheduled task it doesn't do anything. Is say it completed successfully with code 0x0 but it didn't do what it was supposed to do.
I have "Run with highest privileges" checked. I'm logged in as an administrator and I have the task scheduled to run with an administrator account.
I have "Run with highest privileges" checked. I'm logged in as an administrator and I have the task scheduled to run with an administrator account.
net use H: \\wvdl1\wvdl-m\
net use Y: \\wvdl8\D$
cscript /nologo G:\BSEtoNAHLNonHK.vbs
5-14-2009-3-18-15-PM.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ok. No problem. Glad you got it working.
Are you sure it is actually running? Do you see it pop up when it's scheduled time arrives? Another good way to trouble shoot it to put 'pause' after each line in the code and then sit there when it runs to see if anything in the code is causing it to fail. If the batch simply starts Vista will tell you that the file ran. The task scheduler has no idea what the file contains and if the file errors out and fails it will close prematurely even though the task scheduler thinks it completed because it stopped.