JSI Tip 8218. How do I configure WMI logging on Windows XP?

Jerold Schulman

July 5, 2004

1 Min Read
ITPro Today logo in a gray background | ITPro Today

To configure a WMI error log, I have scripted WMIerr.bat.

The syntax for using WMIerr.bat is:

WMIerr LogLevel LogFolder LogSize

Where:

LogLevel  is 0 to turn off logging, a 1 to turn on logging, and a 2 for verbose logging.LogFolder is the folder where the log file will be written.LogSize   is the maximum size of the log file.

NOTE: When a log file reaches the maximum size, it is backed up to .lo_, and a new .log is created. The only exception to this rule is the Framework.log file, which continues to grow.

WMIerr.bat contains:

@echo offIf {%3}=={} @echo Syntax: WMIerr LogLevel LogFolder LogSize&goto :EOFsetlocalset LogLevel=%1set LogFolder=%2set LogSize=%3set LogFolder=%logFolder:"=%#set LogFolder=%logFolder:#=%set LogFolder=%logFolder:#=%set LogFolder=%logFolder:=\%( @echo REGEDIT4 @echo/ @echo [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWBEMCIMOM] @echo "Logging"="%LogLevel%" @echo "Logging Directory"="%LogFolder%" @echo "Log File Max Size"="%LogSize%" @echo/) >"%TEMP%WMIerr.reg"regedit /s "%TEMP%WMIerr.reg"del /q "%TEMP%WMIerr.reg"endlocal



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like