hello,
Im using a script that is based on the "Writing an OK-File" http://www.scriptftp.com/forum/viewtopic.php?f=6&t=38
I want not only delete the OK file but also move/copy the original txt file.
The TRG file gets deleted, so that works and the trg and txt file are in the same local folder
Does anybody know the solution to this question?
appreciate the help
Im using a script that is based on the "Writing an OK-File" http://www.scriptftp.com/forum/viewtopic.php?f=6&t=38
I want not only delete the OK file but also move/copy the original txt file.
Code: Select all
But in the output it says:
Change current remote directory to /test
CHDIR("/test")
# Retrieve the file listing, only txt files
GETLIST($mylist,LOCAL_FILES,"*.txt")
FOREACH $txtfile IN $mylist
# Upload the file
$result=PUTFILE($txtfile)
# Check if the upload were successful
IF($result=="OK")
# Create the ok file
$trgfilename=$txtfile.".trg"
# Download the touch command for windows from
EXEC("D:\FTP_Upload\scripts\touch.exe ".$trgfilename)
# Upload it
$result=PUTFILE($trgfilename)
# If the TRG file was succesully uploaded, delete the local copy
# If the TRG file was succesully uploaded, move the original file to archive
IF($result=="OK")
EXEC("del /F /Q ".$trgfilename)
EXEC('copy ".$txtfile" d:\moved')
END IF
END IF
END FOREACH
CLOSEHOST
Code: Select all
I tried several options but all failed.EXEC("copy ".$txtfile" d:\")
The system cannot find the file specified.
The TRG file gets deleted, so that works and the trg and txt file are in the same local folder
Does anybody know the solution to this question?
appreciate the help
Found solution in other topic:
Code: Select all
EXEC("move ".$txtfile." d:\moved\".$txtfile)
liked Script FTP? Try our other product Email Parser