cmdref.net - Command Reference

This site is command references for system engineers.

User Tools

Site Tools


Top     OS ( Linux )     Middleware     Protocol     Hardware     Programming ( Shell Script )     SiteMap

Sidebar

Top     SiteMap








Reference











.

os:windows:command:index.html



Windows Commands Cheat Sheet

Web Site

Command

System

Operation Command
Displays CMD.EXE environment variables. set
path displays the current command path. path
Sets the command path in the PATH environment variable path %PATH%;C:\test\bin
Displays detailed configuration information about a computer and its operating system systeminfo
systeminfo /s test-server
systeminfo /s test-server /u testdomain.local\USERNAME
Displays a list of currently running processes tasklist
tasklist /s srvmain
tasklist /s srvmain /u maindom\hiropln /p p@ssW23

Software

Operation Command
Creates connections to terminal servers or other remote computers mstsc.exe
mstsc.exe /? ← Displays help at the command prompt.
mstsc.exe /admin ← Connects you to a session for administering the server.
Start Explorer explorer
Start Calcurator calc

Folder

Operation Command
Displays the name of the current directory. cd
chdir
Changes the current directory. cd Folder
cd ..
Changes the root directory, the top of the directory hierarchy for a drive. cd \
cd %userprofile%
Displays a list of a directory's files and subdirectories. dir
Displays the directory structure of a path or of the disk tree
Creates a directory or subdirectory mkdir DIRECTORY
md DIRECTORY
Deletes a directory. rd DIRECTORY ← empty directory
rd Folder1\Folder2 ← Delete only Folder2
rd DIRECTORY /s ← including all files
rd DIRECTORY /s /q ← quiet mode

File

Operation Command
Displays the contents of a text file. type FILE
more FILE ← Displays one screen of output at a time.
Copies one or more files from one location to another. copy FILE FOLDER
copy /y FILE1 FILE2
← Suppresses prompting to confirm that you overwrite an existing destination file.
Deletes one or more files. del FILE
del /Q FILE
← /Q : Quiet mode, do not give a Yes/No Prompt before deleting.
del /S FILE
← /S Delete from all Subfolders (DELTREE)
del /F FILE
← /F : Ignore read-only setting and delete anyway (FORCE)
erase FILE
Renames files or directories. ren SRC DES
rename SRC DES
MIRror a directory tree robocopy SOURCE_FOLDER DESTINATION_FOLDER /mir
robocopy "C:\data" "\\192.168.0.10\C$\data" /mir
robocopy d: g: /mir
robocopy more

Network

Operation Command
Verifies IP-level connectivity to another TCP/IP computer ping HOSTNAME
ping IP_ADDRESS
ping -t HOST
← continue sending Echo Request messages to the destination until interrupted.
← To interrupt and quit ping, press CTRL+C.
Displays all current TCP/IP network configuration values. ipconfig
ipconfig /all ← Display full configuration information.
Display route details netstat -rn
route print
Add a route route add 192.168.0.0 mask 255.255.255.0 192.168.10.1 ← network
route add 192.168.0.5 mask 255.255.255.255 192.168.100.1 ← host
route add -p 192.168.0.0 mask 255.255.255.0 192.168.10.1
← “-p” Create a persistent route
If you want to contain rouring after reboot the system, you must add “-p” option.
Delete the route route delete 192.168.0.0 mask 255.255.0.0 ← network
route delete 192.168.20.1 mask 255.255.255.255 ← host
Change th route route change 157.0.0.0 mask 255.0.0.0 157.55.80.5
Display hostname from IP nbtstat -a IP_ADDRESS

DNS

Operation Command
Displays information that you can use to diagnose DNS infrastructure. nslookup
nslookup IPADDRESS DNSSERVER
nslookup HOSTNAME DNSSERVER
nslookup -type=soa HOSTNAME
nslookup -type=any HOSTNAME DNSSERVER
Flushes and resets the contents of the DNS client resolver cache. ipconfig /flushdns

MAC address

Operation Command
Returns the MAC address getmac
getmac /s srvmain
getmac /s srvmain /u maindom\hiropln /p p@ssW23
Displays entries in the ARP cache arp -a
Deletes an entry in the ARP cache with a specific IP arp -d
arp -d INETADDR

Port

Operation Command
Displays active TCP connections, ports netstat -an
← -a : Displays all active TCP connections and the TCP and UDP ports
← -n : addresses and port numbers are expressed numerically
netstat -an |find "80"


net command

Operation Command
net help
displays user account information net user
net user USERNAME ← detail
change Password net user USER01 PASSWORD
displays the name of the server and the names of local groups on the computer. net localgroup
net session
net accounts
Disk
Operation Command
net share
net use


Time

Operation Command
List Time Server w32tm /query /source
list ntp status w32tm /query /status
w32tm /query /status /verbose
Restart Windows Time net stop w32time && net start w32time




Additional Commands

Package

Commnad Note
UnxUtils
GNU utilities for Win32
http://unxutils.sourceforge.net/
find, date, grep , etc




References




os/windows/command/index.html.txt · Last modified: 2017/01/26 by admin