Showing posts with label CMD. Show all posts
Showing posts with label CMD. Show all posts

Jan 22, 2010

PATH environment variable

Command prompt:

set PATH=%PATH%;c:\newdir

Appends a new path to the PATH variable. However this is scoped to the running CMD window. To make it a permanent change there is a utility called setx.exe (details here)

Jan 20, 2010

Microsoft Log Parser

This is a tool that provides query access to text-based data such as log files, XML/CVS files, as well as Event Log, the Registry, the file system and Active Directory.
Download here.
Here is a sample query that returns the top bandwidth by URL

SELECT top 50 DISTINCT 
SUBSTR(TO_LOWERCASE(cs-uri-stem), 0, 55) AS Url, 
Count(*) AS Hits, 
AVG(sc-bytes) AS AvgBytes, 
SUM(sc-bytes) as ServedBytes 
FROM {filename} 
GROUP BY Url 
HAVING Hits >= 20 
ORDER BY ServedBytes DESC

So at the command line run:
logparser -i:iiswc3 "SELECT STATEMENT GOES HERE"

Here are some links to example queries:
LogParserPlus Queries
ServerFault IIS Queries
Tutorial
IIS Forum

Net command in CMD

Useful when you want to find out where the SHARES are located on a computer:

C:\net share

Returns a list of Share Names <--> Resource (local paths)

Notice that shares ending with $ are admin shares