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.
Post here if you experience file transfer problems or unexpected errors.
I am trying to delete files and subdirs in my local directory. After the upload is done, I would like to delete everything in my working directory and sub directories...Here is my script...
Code: Select all#Have subdirectories under this directory as well. LOCALCHDIR("C:\ftpfiles") GETLIST($list,LOCAL_FILES, "*.*") FOREACH $item IN $list # Upload the file  $result=PUTFILE($item, SUBDIRS) END FOREACH
How can I delete everything in my localdir...Everything under c:\ftpfiles has to be deleted. I tried doing this but doesn't delete everything...None of these worked...Thanks is advance.

# IF($result=="OK")
# EXEC("del " .$item)
# EXEC("del SUBDIRS")
#DELETEFILE($item)
#ELSE
# STOP
Hello,

Try using the dos command RMDIR to delete a directory and its contents. For example;
Code: Select allEXEC("RMDIR c:\blah /s /q")