How to create a script that save logs.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to create a script that, scheduled every night, can save the Domain
Controller logs with names like "ApplLog01012005", "ApplLog01022005",
"SecLog01012005" ...

Anyone can help me?
Thanks a lot, Alex
 
I'd like to create a script that, scheduled every night, can save the Domain
Controller logs with names like "ApplLog01012005", "ApplLog01022005",
"SecLog01012005" ...

Anyone can help me?
Thanks a lot, Alex


See tip 4528 in the 'Tips & Tricks' at http://www.jsifaq.com

See tip 4835.
Assumming you regional short date settings are MM/dd/yyyy


@echo off
setlocal
pushd c:\folder
call univdate
set sys=SysLog%MM%%DD%%YY%
set app=ApplLog%MM%%DD%%YY%
set sec=SecLog%MM%%DD%%YY%
psloglist -s -c app>>%app%
psloglist -s -c sec>>%sec%
psloglist -s -c sys>>%sys%
endlocal


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
@echo off
setlocal
for /f "tokens=2-4 delims=/ " %%a in (
'date /t'
) do set xdate=%%a-%%b-%%c
for /f "tokens=5-6 delims=:. " %%a in (
'echo/^|time^|find "current"'
) do set xtime=%%a.%%b
 
Back
Top