Link to home
Start Free TrialLog in
Avatar of roberts0909
roberts0909Flag for United States of America

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?

ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Looks like this is pointing to an invalid network resource:

ERROR_BAD_NETPATH
53
0x35
The network path was not found.

http://msdn2.microsoft.com/en-us/library/ms681382.aspx
Avatar of roberts0909

ASKER


Here's the batch file:
SCP d:\sftp_Automated\AUTO_SCP.bat ftitst@D11:/SOURCE  

(/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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is d:
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.
Avatar of rockyboy123
rockyboy123

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 :)
Sorry, I didn't realize that.  No mapped drives are used.  D: refers to a local directory.
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.