Does anyone have a batch file (I'm on NT) that will rename the alert.log with the date added to it? I'm looking into writing this myself, but it is proving to be more problematic than expected. Hoping to save some time...
Thanks
-mcslain
Printable View
Does anyone have a batch file (I'm on NT) that will rename the alert.log with the date added to it? I'm looking into writing this myself, but it is proving to be more problematic than expected. Hoping to save some time...
Thanks
-mcslain
@ECHO Off
FOR /F "TOKENS=1,2,3,4 DELIMS=/, " %%A IN ('DATE/T') DO SET DYNOM=%%A
FOR /F "TOKENS=1,2,3,4 DELIMS=/, " %%A IN ('DATE/T') DO SET DYMON=%%B
FOR /F "TOKENS=1,2,3,4 DELIMS=/, " %%A IN ('DATE/T') DO SET DYDT=%%C
FOR /F "TOKENS=1,2,3,4 DELIMS=/, " %%A IN ('DATE/T') DO SET DYYR=%%D
ren alert.log "Alert-"%DYNOM%-%DYMON%-%DYDT%-%DYYR%.log
Hope this helps
Anurag