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?

roberts0909Asked:
Who is Participating?
 
SteveGTRConnect With a Mentor Commented:
Can you post the batch processing?

Things to watch out. The account that the scheduled task runs under. Looks like you got that one taken care of. The 2nd thing to watch is the use of mapped drive letters to network resources. You should use UNC's instead: \\server\share\dir.
0
 
SteveGTRCommented:
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
0
 
roberts0909Author Commented:

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)?  
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
rockyboy123Connect With a Mentor Commented:
The local system user should have Write access to that folder. Let me know if you face same error or not.
0
 
SteveGTRCommented:
What is d:
0
 
roberts0909Author Commented:
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.
0
 
rockyboy123Commented:
Specify '@' in destinition path. It will get resolved
0
 
SteveGTRCommented:
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 :)
0
 
roberts0909Author Commented:
Sorry, I didn't realize that.  No mapped drives are used.  D: refers to a local directory.
0
 
roberts0909Author Commented:
I guess i fubared  the point awards, sorry about that.  Splitting between all answerers...
0
 
IDPIncCommented:
So what was the solution?  I am having the same problem.
0
All Courses

From novice to tech pro — start learning today.