Archives
- July 2019
- January 2019
- November 2018
- August 2018
- July 2018
- February 2018
- November 2017
- October 2017
- July 2017
- June 2017
- May 2017
- April 2017
- January 2017
- December 2016
- November 2016
- August 2016
- January 2015
- December 2014
- March 2014
- April 2013
- December 2010
- November 2009
- September 2009
- June 2009
- March 2009
- February 2009
- November 2008
- October 2008
- August 2008
- July 2008
- January 2008
Network drive not available when the FTP script is scheduled
21st July 2018As all Windows applications, ScriptFTP supports the use of UNC paths and network drives. You can use the files and folders stored in them as if they were located in hard drive of the machine where ScriptFTP is running. For instance:
# Upload to the FTP server all the Excel files stored in the mapped network drive Z PUTFILE("Z:\the_folder\*.xlsx") # Upload to the FTP server all the Word documents stored in a network share called Reports # under the computer named ACCOUNTING-PC-1 PUTFILE("\\ACCOUNTING-PC-1\Reports\*.docx")
A very common issue that sometimes happens with the use of network shares is that they will work when you click Run in the ScriptFTP window but will not if you schedule the script. When scheduled you may get an error as if the network drive does not exist at all, even if you are connected to the network. For example if the mapped drive is Z: and we try to set the current working directory to Z:\XML\Invoices:
LOCALCHDIR("Z:\XML\Invoices") ****** LOCALCHDIR Error #15000 ****** Could not find a part of the path 'F:\XML\Invoices\'.
If this happens you should check the following:
– Check that, if the task is set to run whether or not the user is logged in, the script creates the network share itself using the following command:
# Map the network drive from the script. Just in case # the user is not logged in EXEC("net use Y: \\server\share")
This is because mapped network drives are created when the user logs in and if the user is not logged in the mapped network drive will not be available. That command creates the mapping and you should use it before using the files on that drive.