Monday, July 5, 2010

Setting Environment Path for Log Parser

Microsoft Log Parser is a nifty little command line tool that can be use to parse and query text-based log files, such as IIS log, windows event viewer, SQL Server error log and others. I’ve mentioned this before, one thing that I like about Microsoft Log Parser is the use of SQL language that we can use to query the log files (I guess I am a tad biased).

After installing Microsoft Log Parser, in order to use it, you need to go to command line application and go to the C:\Program Files\Log Parser 2.2 (Version 2.2 is the latest version of Microsoft Log Parser). If you do it from any other directory, you will get the following message:

‘LogParser.exe’ is not recognized as an internal or external command, operable program or batch file.

To get around this, in order for you to be able to run Log Parser to run from any directory that you have open when using command line, you can set the Log Parser directory as one of the environment path. To do that in Windows Vista system:

  • Go to Start menu and then Control Panel.
  • In Control Panel, select System and Maintenance.
  • Under System and Maintenance, click on System.
  • On the left side, there should be Advanced System Settings. Click on that one and the User Account Control window might pop-up. Click on Continue on this.
  • On the System Properties window, under the Advanced tab, click on the Environment Variables button.
  • On the Environment Variables window, under the System variables section, look and click on Path. Once Path is selected, click on the Edit button.
  • You should see a window something like the one below. At this point go to the very end of the variable values field and type in semicolon and the C:\Program Files\Log Parser 2.2.


  • Once done, click on the OK button. Then click on the OK button on the Environment Variables window. Then click on the OK button again on the System Properties window.
  • If you have any command line open you might want to close them, or start a new one and by now you should be able to use the Log Parser tool from any directory other than the C:\Program Files\Log Parser 2.2 directory.

Related Posts:

No comments:

Post a Comment