Windows operating systems have a variety of command-line utilities and shell commands that can be used to interact with the system, manage files, and configure network settings, among other things.
Here are some common commands used in the Windows Command Prompt (cmd) or PowerShell:
ipconfig
– Displays all current TCP/IP network configuration values.
ipconfig
ping
– Tests the reachability of a network host.
ping google.com
tracert
– Traces the route taken by packets to reach a network host.
tracert google.com
nslookup
– Displays information that you can use to diagnose Domain Name System (DNS) infrastructure.
nslookup google.com
netstat
– Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, and more.
netstat
route
– Manipulates network routing tables.
route print
getmac
– Displays the media access control (MAC) address of your network adapter.
getmac
tasklist
– Displays a list of currently running processes.
tasklist
taskkill
– Terminates tasks by process id or image name.
taskkill /PID process_id
shutdown
– Allows proper local or remote shutdown of a machine.shutdown /r /t 0
dir
– Lists files and subdirectories in a directory.dir
cd
– Changes the directory.cd \path\to\directory
copy
– Copies files from one location to another.copy source destination
del
– Deletes one or more files.del filename
mklink
– Creates a symbolic link.bash mklink Link Target
These commands provide a range of functionalities for interacting with the system, from viewing network configurations, troubleshooting network issues, managing tasks, to manipulating files and directories. Each command has its own set of options and arguments, which you can explore by typing the command followed by /?
(e.g., ipconfig /?
, ping /?
, etc.) in the command prompt or by looking at the official documentation.
In addition to the previous commands, here are some more commands and utilities you might find useful in Windows environments:
systeminfo
: Provides detailed configuration information about a computer and its operating system.systeminfo
sfc
: Scans and repairs system files.sfc /scannow
chkdsk
: Checks a disk and displays a status report.chkdsk C:
diskpart
: Provides disk partitioning and management functions.diskpart
powershell
: Starts a new instance of PowerShell, a more powerful command-line shell.powershell
regedit
: Opens the Registry Editor.regedit
gpupdate
: Updates Group Policy settings.gpupdate /force
gpresult
: Displays Group Policy settings and Resultant Set of Policy (RSOP) for a user or a computer.gpresult /r
net
: Provides a variety of network services such as user, group, share management, and more.net user
netsh
: Allows you to, either locally or remotely, display or modify the network configuration of a computer.netsh interface ipv4 show config
nbtstat
: Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).nbtstat -a hostname
robocopy
: An advanced copy utility with features like automatic retry and copy resumption.robocopy source destination /MIR
schtasks
: Schedules commands and programs to run periodically or at a specific time.bash schtasks /create /tn "TaskName" /tr "TaskRun" /sc daily /st 12:00
These additional commands and utilities cover a range of system administration and troubleshooting tasks. Some of them, such as diskpart
, regedit
, or netsh
, can significantly modify system configurations and should be used with caution, especially in production environments.
xcopy
: An extended copy utility used for copying multiple files or entire directory trees from one directory to another.xcopy source destination /E
find
: Searches for a text string in a file or files.find "text" filename.txt
findstr
: Searches for patterns of text in files using regular expressions.findstr "pattern" filename.txt
sort
: Reads input, sorts data, and writes the results to the screen, a file, or another device.sort filename.txt
tree
: Graphically displays the directory structure of a drive or path.tree
attrib
: Displays, sets, or removes attributes assigned to files or directories.attrib +H filename.txt
fc
: Compares two files or sets of files and displays the differences between them.fc file1.txt file2.txt
more
orless
: Displays output one screen at a time.dir | more
color
: Sets the default console foreground and background colors.color 0A
title
: Sets the window title for a CMD.EXE session.title My Command Prompt
md
ormkdir
: Creates a directory.md directoryname
rd
orrmdir
: Removes a directory.rd directoryname
set
: Displays, sets, or removes CMD environment variables.set variable=value
echo
: Displays messages or turns command echoing on or off.bash echo Hello World
These commands further extend the capabilities of command-line operations on Windows systems, facilitating a wide range of tasks from file management to system configuration. As with the earlier commands, caution should be exercised to ensure that commands are executed correctly, especially when modifying system settings or file attributes.
shutdown
: Allows you to shut down or restart a local or remote computer.shutdown /r /t 0
ping
: Tests the network connection between your computer and a specified host.ping example.com
ipconfig
: Displays all current TCP/IP network configuration values.ipconfig /all
tracert
: Traces the route of packets to a network host.tracert example.com
nslookup
: Queries DNS servers to find DNS details, including IP addresses of a particular computer.nslookup example.com
tasklist
: Displays all currently running tasks including services.tasklist
taskkill
: Ends one or more tasks or processes.taskkill /PID process_id
whoami
: Outputs the name of the user currently logged in and the name of the domain.whoami
getmac
: Displays the media access control (MAC) address of your network card.getmac
driverquery
: Provides a list of all installed device drivers and their properties.driverquery
path
: Displays or sets a search path for executable files.path
timeout
: Pauses the command processor for the specified number of seconds.timeout /t 10
assoc
: Displays or modifies file extension associations.assoc .txt
ftype
: Displays or modifies file types used in file extension associations.bash ftype txtfile
These commands cater to various network and system management tasks, including troubleshooting, diagnostics, and configuration adjustments. They are invaluable tools for administrators and those looking to automate or script tasks within a Windows environment.
bcdedit
: Manages boot configuration data (BCD) for Windows.bcdedit /enum
cipher
: Displays or alters the encryption of directories and files on NTFS volumes.cipher /E /S:C:\foldername
compact
: Displays or changes the compression state of files or directories on NTFS partitions.compact /c /s:C:\foldername
format
: Formats a disk for use with Windows.format D: /fs:NTFS
chkdsk
: Scans and repairs errors on a disk drive.chkdsk C: /f
sfc
: Scans and repairs system files.sfc /scannow
net user
: Manages user accounts, including creating, modifying, and deleting user accounts.net user username password /add
net localgroup
: Manages local groups on a computer.net localgroup Administrators username /add
net share
: Displays or configures shared resources on a computer.net share
net use
: Connects or disconnects a computer from shared resources or map network drives.net use Z: \\server\share /user:username password
netstat
: Displays active network connections, routing tables, and network statistics.netstat -ano
telnet
: Connects to remote computers using the Telnet protocol.telnet example.com 80
regedit
: Opens the Windows Registry Editor for viewing and editing the Windows Registry.regedit
gpupdate
: Updates Group Policy settings.bash gpupdate /force
These commands cover a wide range of system administration and configuration tasks, including disk management, user account management, network resource sharing, and more. Be cautious when using commands that modify system settings or data, as they can have a significant impact on the stability and security of the system.
gpresult
: Displays Group Policy settings and Resultant Set of Policy (RSOP) for a user or a computer.gpresult /r
assoc
: Displays or modifies file extension associations.assoc .txt
ftype
: Displays or modifies file types used in file extension associations.ftype txtfile
hostname
: Displays the name of the current host (computer) on the network.hostname
schtasks
: Schedules commands and programs to run periodically or at a specific time.schtasks /create /tn "TaskName" /tr "TaskRun" /sc daily /st 12:00
xcopy
: An extended copy utility used for copying multiple files or entire directory trees from one directory to another.xcopy source destination /E
expand
: Extracts files from compressed .cab cabinet files.expand source.cab -F:* destination
pnputil
: Manages the driver package repository on a local or remote computer.pnputil -i -a driver.inf
bcdboot
: Sets up the boot files on a system partition to create a new system BCD store.bcdboot C:\Windows /s S:
wevtutil
: Manages event logs and publishers.wevtutil qe Application
slmgr
: Windows Software Licensing Management Tool – used to activate Windows or change the product key.bash slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
These additional Windows commands extend your control over system and network management, including tasks like file copying, event log management, and driver installation. When using these commands, exercise caution, especially when modifying system configurations or scheduling tasks, as they can impact the stability and security of your Windows system.