@Echo Off ON ERRORMSG GOTO Error :: Update files via FTP, assuming the FTP connection has been established already. SetLocal Iff "%1" EQ "DoIt" Then *Set Action=Copy /G /H IFTP >&NUL IFF %_? NE 0 THEN ECHO You must have an FTP connection active. QUIT ENDIFF Else Set Action=Echo Echo This is only a test! Pause EndIff UnAlias * SET LastUpdated=%@FileDate[LastUpdated.txt]@%@FileTime[LastUpdated.txt,,s] ECHO LastUpdated: %LastUpdated If Exist %Temp\Files.tmp Del /q %Temp\Files.tmp SET Logfile=_%@REPLACE[-,,%_ISODate]%@REPLACE[:,,%_Time].log DIR /[d%LastUpdated] /[!*.log *-old*.* LastUpdated.* Exclude.lst] /S /B /A:-D >!%Temp\Files.tmp SETDOS /P$ :: For each file ... For %fn In (@%Temp\Files.tmp) Do GoSub Process ECHO Done. | TEE /A %Logfile Iff %Action NE Echo Then MSGBOX YESNO "%0"] Change LastUpdated.txt? Iff +%_? == +10 Then If Exist LastUpdated.sav Del /r LastUpdated.sav Ren LastUpdated.txt LastUpdated.sav Touch /c LastUpdated.txt EndIff EndIff Quit :Error ::SETDOS /Y1 PAUSE What happened? QUIT :Process SET fn=%@Replace[%_cwds,,%fn] FFind /t"=%fn=" Exclude.lst >NUL If +%_? NE +0 Goto IsNew Echo XCL %fn | TEE /A %Logfile Return :IsNew Echo Upd file: %fn with date: %@FileDate[%fn]@%@FileTime[%fn,,s]| TEE /A %Logfile IF "%Action" NE "Echo" @ECHO ON %Action %fn %@Replace[\,/,"ftp:/html/%fn"] @ECHO OFF Return