Can someone please translate this batch file below or redirect me to site where I can check the syntax for it.
<BATCH FILE log.bat>
@echo on
for /f "tokens=1-7 delims=: " %%i in ('now.exe')
do set iislogs=%%j%%k%%o%%l%%m%%n%%i
"c:\program files\winzip\Wzzip.exe" %iislogs%.zip *.log
del *.log
<BATCH FILE END>
I'd like to customised it in order to automatically zip IIS log file. At moment it only works if log files, now.exe and log.bat reside on same directory.
If I move the log.bat file to another directory then specify the file path to now.exe. I would get the following output if I run it.
C:\>log\W3svc3\log.bat
C:\>FOR /F "tokens=1-7 delims=: " %i in ('c:\log\W3svc12\now.exe') do set iislog
s=%j%k%o%l%m%n%i
C:\>set iislogs=Jan242002125444Thu
C:\>"c:\program files\winzip\Wzzip.exe" Jan242002125444Thu .zip *.log
WinZip(R) Command Line Support Add-On Version 1.0 (Build 3181)
Copyright (c) WinZip Computing, Inc. 1991-2000 - All Rights Reserved
Warning: name not matched: *.log
Adding .zip
creating Zip file Jan242002125444Thu.zip
C:\>del *.log
Could Not Find C:\*.log
:cool: