Computer Voodoo logo

using the command line

Typing the command followed by a space and /? will typically display brief help on the command.

Anything listed with <angle brackets> is a variable supplied by the user.

networking

ipconfig /all
lists all network adapters and their current status
netsh interface ip set address "<interface name>" static <ip address> <netmask> <default gateway> <metric>
netsh interface ip set address "Local Area Connection" static 192.168.5.16 255.255.255.0 192.168.5.1 1
Changes the IP address to 192.168.5.16/24 with a gateway of 192.168.5.1
The lower the metric value the higher the rank.
netsh interface ip set address "Local Area Connection" source=dhcp
Sets IP using DHCP
net view \\<server_name>
view shares on computer named <server_name>
net view /DOMAIN:<domain_name>
view shares on a domain
net use <drive_letter>: \\<server_name>\<directory> /user:<user_name>
map a share to a drive letter using the <user_name> as the login name
net use <drive_letter>: /delete
remove a mapped drive
net use <port>: \\<server_name>\<printer_name>
setup a connection to a shared printer on <server_name> using a particular port (LPT1, COM2, etc)
netsh
When you want networking information you can use the Network Shell.
netsh diag show all will display information about the current network configuration.
netstat
List active connections on your computer.
nslookup <domain_name>
Performs a DNS lookup on domain_name to determine its IP address.
ping <domain_name_or_IP>
Similar to a SONAR ping with submarines, ping will send out a signal to a target and report how long the round trip takes.
tracert <domain_name_or_IP>
Runs a traceroute command to show the hops the connection takes between your computer and the destination.

administration

tasklist
Prints a rundown of the processes that are currently running on the system. Add /SVC to list services within each process.
taskkill
Kills off a process that will not respond.
expand <source> <destination>
Sometimes you need files tucked away in cabinet (.CAB) files.
-r renames the destination filenames based upon the source filename.
-D displays the list of files contained within the .CAB
-F:<files> decompresses one or more files from the .CAB.

environmental variables

Type the echo command before the variable to display the contents of the variable (e.g. echo %userprofile%).

%SystemRoot%
The Windows directory. Either C:\Windows or C:\WINNT
%UserProfile%
C:\Documents and Settings\{UserName} or C:\Users\{UserName}
%UserName%
Take a guess.