System Error. Code: 3

Advertisement

npunjabi
Joined:
Posts:
1
Location:
Baltimore, MD

System Error. Code: 3

I am new to WinSCP. I have been not been able to figure out a problem for the last two days. I have written a WinSCP script that I can call using a bat file. It works file when I manually execute the bat file. However, when I use the Windows Task Scheduler I get an error. The script opens up the SFTP, switches to a directory called Nox, but when I want to switch to the local mapped directory X:\ I get the error. See script below.
lcd /home/other/Nox
cd X:\
get  -delete * 
exit
All of it works if I manually execute my bat file. However, when I run the same bat file from the Windows Task Scheduler, I get the error. I have attached part of the log file below. Any help would be appreciated. I apologize if this is something that has been addressed before.
> 2018-03-09 09:22:14.682 Script: lcd X:\
< 2018-03-09 09:22:14.682 Script: Error changing directory to 'X:\'.
< 2018-03-09 09:22:14.682 System Error.  Code: 3.
< 2018-03-09 09:22:14.682 The system cannot find the path specified
. 2018-03-09 09:22:14.682 Script: Failed
. 2018-03-09 09:22:14.682 Script: Exit code: 1
. 2018-03-09 09:22:14.682 Closing connection.
I have made sure that in the task properties, I have checked Run Whether User is logged or or not. I have also enabled Run with highest privileges. Finally, I have Configured for Windows 7 which is the OS that I am using. Thank you.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: System Error. Code: 3

This is covered in FAQ:
My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong?

If your script refers to mapped network drives, it may fail if those drives are not mapped under the services’ account or if the account does not even have an access to the network drive.

Use an UNC path to a shared folder, instead of a path to the drive mapped to the shared folder. Make sure the service’s account has an access to the shared folder.

Reply with quote

Advertisement

You can post new topics in this forum