* Windows 2003 only

MSI

To install an MSI package:

msiexec /i package.msi

System

To display system information:

systeminfo

*To set an environmental variable (/M: system wide):

setx PHPRC "C:\php" /M

User

*To display user name:

whoami

*To display groups:

whoami /groups

Files

To examine NTFS ACLS:

cacls filename

*To take ownership of files/directories:

takeown

To list open files (seems to require Administrator privs.):

openfiles

Network

To display interface configurations:

ipconfig /all

To flush DNS client cache:

ipconfig /flushdns

To display DNS cache:

ipconfig /displaydns

To do DNS queries (type help):

nslookup

To display open ports and PIDs:

netstat -ao

To display ports and executable name:

netstat -ab

IIS

To restart IIS:

iisreset /restart

RDP

*To list RDP sessions:

query session

*To reset (delete) RDP session:

reset session {SessionName|SessionID}

Processes

To display running processes:

tasklist

To kill a process:

taskkill /pid ProcessID

Eventlog

To view event log entries:

cscript "c:\windows\system32\eventquery.vbs" /l {application|system|security|"dns server"|*}

For example, to list shutdowns:

cscript "c:\windows\system32\eventquery.vbs" /l system /fi "id eq 1074 or id eq 1076" /fi "source eq user32" /v

Shutting Down

To shutdown the computer (planned, other reason):

shutdown /s /c "Reason for shutdown." /d p:0:0

To reboot the computer:

shutdown /r /c "Reason for reboot." /d p:0:0

Links

Windows XP

Windows 2003