LOCALCHDIR Change the current local directory

path: absolute or relative local path, e.g. C:\Users\John\Docs\ or John\Docs

Remarks:

Use LOCALCHDIR to set the current local directory before calling GETFILE. Files will be downloaded to that directory.

Return value:

LOCALCHDIR will return “OK” if ScriptFTP can access the remote directory.
If the operation fails it will return an error code. You may retrieve the return value and execute various operations depending on this value. See Error handling.

# Connect to serverOPENHOST("ftp.myftp.com")# Change the current local directory# All files will now be downloaded hereLOCALCHDIR("C:\backup\web")# Download filesGETFILE("web/*.*",SUBDIRS)# Go to the parent directoryLOCALCHDIR("..")# Download filesGETFILE("pricelist.xls")# Close connectionCLOSEHOST