WORKINGDIR Change local default (working) folder |
Top Previous Next |
This script command sets the default folder for all file-oriented script commands. Robo-FTP always has a current working folder on the local PC. If a file name without a full path is used in any script command then Robo-FTP assumes the file is located in the current working folder.
Calling this command without the [ folder name ] argument causes the path of the current working folder to be echoed to the console window.
The current working folder is always maintained in the %currentlocaldir variable.
Consider the following example.
;; read record in "c:\Program Files\Robo-FTP X.X\example.txt" WORKINGDIR "c:\Program Files\Robo-FTP X.X" READFILE "example.txt" first_record
If a partial path is specified, it and the previous working folder are used to define the new working folder.
;; current working folder is "c:\Program Files\Robo-FTP X.X" WORKINGDIR "test" ;; new working folder is now "c:\Program Files\Robo-FTP X.X\test"
If two periods “..” are specified, the new working folder is set one folder above the previous working folder.
;; current working folder is "c:\Program Files\Robo-FTP X.X" WORKINGDIR ".." ;; new working folder is now "c:\Program Files"
Important This command overrides the Working Directory folder selected on the Files menu in the Robo-FTP Configurator. The directory change made by WORKINGDIR is global within the Robo-FTP script environment. If WORKINGDIR is called in a function or a called script, we recommend that the current working folder be saved on entry and restored on exit to prevent unintended consequences. See the help topic for the %currentlocaldir internal variable for an example.
The directory change made by WORKINGDIR will be overwritten if you subsequently use FTPLOGON to connect to a Managed Site that specifies a different Initial Working Directory.
Robo-FTP only has a current remote folder while actually connected to a remote site. Use the FTPCD script command to set the current directory on a remote site and the FTPPWD command to echo the name of the current remote folder without changing the current remote folder.
Related command(s): FTPCD, FTPPWD, MAKEDIR, DELDIR, LISTDIR See also: %currentlocaldir, %currentsitedir |