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...
# IF($result=="OK")
# EXEC("del " .$item)
# EXEC("del SUBDIRS")
#DELETEFILE($item)
#ELSE
# STOP
Code: Select all
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. #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
# 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;
Try using the dos command RMDIR to delete a directory and its contents. For example;
Code: Select all
EXEC("RMDIR c:\blah /s /q")
liked Script FTP? Try our other product Email Parser