Windows Commands Cheat Sheet (Cmdref - Net - Cheat Sheet and Example)
Windows Commands Cheat Sheet (Cmdref - Net - Cheat Sheet and Example)
net
Command
Help
command /?
Exaple)
systeminfo /?
robocopy /?
net /?
net user /?
shutdown /?
System
Operation Command
shutdown /s /t 10
shutdown /r /t 10
set ← cmd
Sets the command path in the PATH environment variable path %PATH%;C:\test\bin
systeminfo
Displays detailed configuration information about a computer and its systeminfo /s test-server
tasklist
tasklist /s SERVER
Software
Operation Command
Operation Command
mstsc
mstsc /v:192.168.0.10
explorer
Start Explorer
explorer . ← start Explorer with current folder
Operation Command
Folder
Operation Command
cd
c:
Change Drive d:
cd /d d:
cd Folder
cd $env:VAGRANT_HOME ← powerhsell
cd ..
Changes the root directory, the top of the directory hierarchy for a drive. cd \
cd %userprofile%
mkdir DIRECTORY
Deletes a directory.
rd DIRECTORY /s ← including all files
File
Operation Command
type FILE
Copies one or more files from one location to copy /y FILE1 FILE2
del FILE
del /Q FILE
del /S FILE
del /F FILE
erase FILE
robocopy more
(https://cmdref.net/os/windows/command/robocopy.html)
Network
Operation Command
Operation Command
ping HOSTNAME
ping IP_ADDRESS
netstat -rn
Add a route
← “-p” Create a persistent route
If you want to contain rouring after reboot the system, you must add “-
p” option.
Operation Command
nslookup
Displays information that you can use to diagnose DNS (Domain Name System) nslookup HOSTNAME DNSSERVER
Flushes and resets the contents of the DNS (Domain Name System) client
ipconfig /flushdns
resolver cache.
MAC address
Operation Command
getmac
arp -d
Operation Command
netstat -an
← -a : Displays all active TCP connections and the TCP and UDP ports
Displays active TCP connections, ports ← -n : addresses and port numbers are expressed numerically
net command
Operation Command
net help
net user
Example)
displays the name of the server and the names of local groups on the
net localgroup
computer.
Operation Command
net session
net accounts
Disk
Operation Command
net share
net use
Time
Operation Command
w32tm /resync
Restart Windows Time net stop w32time && net start w32time
Operation Command
w32tm /resync
>Get-ItemProperty -Path
"HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters"
## Enable NTP
>Set-ItemProperty -Path
"HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters" -Name "NtpServer"
-Value "time.cloudflare.com,0x8"
Group Policy
Operation Command
Operation Command
rsop
gpresult /H check.html #
dsquery
Operation Command
Operation Command
dsquery user
Display user
dsquery user ou=Tokyo,dc=example,dc=local
Display Computer
dsquery computer -name PC*
netsh winhttp import proxy source=ie Use the same settings as Internet Explorer
Additional Commands
Commnad Note
pscp.exe http://www.chiark.greenend.org.uk/~sgtatham/putty/download.ht
(https://cmdref.net/os/windows/command/pscp.html) (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.ht
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.ht
psftp.exe
(http://www.chiark.greenend.org.uk/~sgtatham/putty/download.ht
Package
Commnad Note
UnxUtils
http://unxutils.sourceforge.net/ (http://unxutils.sourceforge.net/)
cmdLauncher
You can easily access the software, file, folder you registerd.