roberts0909
asked on
Batch file runs when executed manually but not as a Scheduled Task
I have a .bat that copies a set of files from one server to another. The batch file runs perfectly when executed manually, but fails when set up as a scheduled task.
The scheduled task is set to run as a domain service account that is a member of Local Administrators on both servers. The batch file completes when executed manually by the same user.
When the Scheduled Task is run by the domain account it begins to run but errors with "Finished 2/1/2008 9:35:50 AM Result: The task completed with an exit code of (53)."
The service account has the ability to logon as a batch job, and has explicit permissions to cmd.exe.
What am I missing?
The scheduled task is set to run as a domain service account that is a member of Local Administrators on both servers. The batch file completes when executed manually by the same user.
When the Scheduled Task is run by the domain account it begins to run but errors with "Finished 2/1/2008 9:35:50 AM Result: The task completed with an exit code of (53)."
The service account has the ability to logon as a batch job, and has explicit permissions to cmd.exe.
What am I missing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here's the batch file:
SCP d:\sftp_Automated\AUTO_SCP
(/SOURCE is set to D11\Development. We're using Attachmate's Secure IT for SCP, and have that variable defined there.) ftitst is the domain service account that is a member of local admins on both servers. The script is just a test to make sure we can run an SCP script as a scheduled task. It's only purpose is to copy the AUTO_SCP.bat file to the target server D11.
The exit code is 53, but can the network souce is invalid if I can run the batch file sucessfully by double clicking it (while logged in as ftitst)?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is d:
ASKER
rockyboy123: The user ftitst is a local admin and has full control.
SteveGTR: not sure which D you're asking about, but d:\sftp_Automated refers to a directory named sftp_Automated on the sending system. d11 is the netbios name of the sending system.
SteveGTR: not sure which D you're asking about, but d:\sftp_Automated refers to a directory named sftp_Automated on the sending system. d11 is the netbios name of the sending system.
Specify '@' in destinition path. It will get resolved
I was asking if d: was a network resource accessed through a mapped drive letter. I guess I could have been a little more clear on that :)
ASKER
Sorry, I didn't realize that. No mapped drives are used. D: refers to a local directory.
ASKER
I guess i fubared the point awards, sorry about that. Splitting between all answerers...
So what was the solution? I am having the same problem.
ERROR_BAD_NETPATH
53
0x35
The network path was not found.
http://msdn2.microsoft.com/en-us/library/ms681382.aspx