ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
Hi - my script needs to change the local directory to a mapped network drive.

All is well when I run the script manually from within ScriptFTP:
LOCALCHDIR("B:")
Changing current local directory to B:
OK
However, when I call the script automatically from Task Scheduler it fails:
LOCALCHDIR("B:")
Changing current local directory to B:
***** LOCALCHDIR Error #3 : Cannot change current local dir to B:
***** The system said: The system cannot find the path specified.
I get exatcly the same problem using EXEC("chdir B:").

Any ideas how to fix this please?
FTP Script
  1. LOCALCHDIR("B:\")
  2. EXEC("chdir /D B:\").
Hi,

I have tested using LOCALCHDIR("B:") in my machine and it works fine.

As you get the error only when the the script is run under the scheduler I would check that B: is available when the user is not logged in or available for the user that runs the scheduled task (it may be different than the one you use to log in and test ScriptFTP)

By the way, both LOCALCHDIR("B:\") and EXEC("chdir /d B:\") produce the same result. You can use either of them as noted by Wandrey.
Hi Guys,

I can see this is from a while ago but there is no resolution,

I experience the same issue; when using a mapped drive and the localchdir command it will run manually or in a bat file but as soon as you put it in the scheduler then it erorrs with;

when running via scheduler;
[quote]'***** LOCALCHDIR Error #3 : Cannot change current local dir to p:\SAF\data\incoming
***** The system said: The system cannot find the path specified.'[/quote]

otherwise when running manually or in a bat script - no error;
[quote]'LOCALCHDIR("p:\SAF\data\incoming")
Changing current local directory to p:\SAF\data\incoming'[/quote]

Scheduler is set to run the file direct from script ftp or from a bat, both error.
example BATCH file loader:
[quote]C:\admin\upload_information_SAF.bat
"C:\Program Files (x86)\ScriptFTP\ScriptFTP.exe" "c:\admin\upload_information_SAF.ftp" /AUTOCLOSE[/quote]

I'm hoping someone can help with a solution?
Hi Ryan,

If it happens only when the script is scheduled I would check if it is a permissions issue. Note that scheduled tasks are run sometimes under a different user account. Check this in the windows task manager when the script is running, there is a column that shows which user runs the process.

Note also that mapped network drives are available only when the user that created the network drive logs in. To fix this try using UNC paths instead of drive letters, for example: \\JOHNS-PC\Shared folder 1\subdir\)

I hope that I have given enough clues to fix the issue. Please, keep us updated. This seems to be a common issue.