Batch file help. %%i was unexpected at this time (also Pause is ignored)
I have the following batch file running fine at an other site sending me latest NTbackup Logs.
When trying to run it on this server (Server 2003 Standard Server SP1) it fails. Pls see below
::Batch file - send out latest backuplog*.log file in current folder
rem Gathering all files in current folder with mask specified...
rem /A-D... no directories (or folders)
rem /OD... sort by date (oldest first)
rem /B... no heading information or summary rem /TW... last Writen file
dir backuplog*.log /A-D /OD /TW /B >tmp.txt
rem parse tmp.txt file to get last line...
rem last line is latest .log file...
rem so attach.txt will contain .log file we want...
for /F "tokens=*" %i in (tmp.txt) do echo %i >attach.txt <-- this is where it fails with a %%i was unexpected at this time.