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 0dir– Lists files and subdirectories in a directory.dircd– Changes the directory.cd \path\to\directorycopy– Copies files from one location to another.copy source destinationdel– Deletes one or more files.del filenamemklink– 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.systeminfosfc: Scans and repairs system files.sfc /scannowchkdsk: Checks a disk and displays a status report.chkdsk C:diskpart: Provides disk partitioning and management functions.diskpartpowershell: Starts a new instance of PowerShell, a more powerful command-line shell.powershellregedit: Opens the Registry Editor.regeditgpupdate: Updates Group Policy settings.gpupdate /forcegpresult: Displays Group Policy settings and Resultant Set of Policy (RSOP) for a user or a computer.gpresult /rnet: Provides a variety of network services such as user, group, share management, and more.net usernetsh: Allows you to, either locally or remotely, display or modify the network configuration of a computer.netsh interface ipv4 show confignbtstat: Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).nbtstat -a hostnamerobocopy: An advanced copy utility with features like automatic retry and copy resumption.robocopy source destination /MIRschtasks: 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 /Efind: Searches for a text string in a file or files.find "text" filename.txtfindstr: Searches for patterns of text in files using regular expressions.findstr "pattern" filename.txtsort: Reads input, sorts data, and writes the results to the screen, a file, or another device.sort filename.txttree: Graphically displays the directory structure of a drive or path.treeattrib: Displays, sets, or removes attributes assigned to files or directories.attrib +H filename.txtfc: Compares two files or sets of files and displays the differences between them.fc file1.txt file2.txtmoreorless: Displays output one screen at a time.dir | morecolor: Sets the default console foreground and background colors.color 0Atitle: Sets the window title for a CMD.EXE session.title My Command Promptmdormkdir: Creates a directory.md directorynamerdorrmdir: Removes a directory.rd directorynameset: Displays, sets, or removes CMD environment variables.set variable=valueecho: 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 0ping: Tests the network connection between your computer and a specified host.ping example.comipconfig: Displays all current TCP/IP network configuration values.ipconfig /alltracert: Traces the route of packets to a network host.tracert example.comnslookup: Queries DNS servers to find DNS details, including IP addresses of a particular computer.nslookup example.comtasklist: Displays all currently running tasks including services.tasklisttaskkill: Ends one or more tasks or processes.taskkill /PID process_idwhoami: Outputs the name of the user currently logged in and the name of the domain.whoamigetmac: Displays the media access control (MAC) address of your network card.getmacdriverquery: Provides a list of all installed device drivers and their properties.driverquerypath: Displays or sets a search path for executable files.pathtimeout: Pauses the command processor for the specified number of seconds.timeout /t 10assoc: Displays or modifies file extension associations.assoc .txtftype: 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 /enumcipher: Displays or alters the encryption of directories and files on NTFS volumes.cipher /E /S:C:\foldernamecompact: Displays or changes the compression state of files or directories on NTFS partitions.compact /c /s:C:\foldernameformat: Formats a disk for use with Windows.format D: /fs:NTFSchkdsk: Scans and repairs errors on a disk drive.chkdsk C: /fsfc: Scans and repairs system files.sfc /scannownet user: Manages user accounts, including creating, modifying, and deleting user accounts.net user username password /addnet localgroup: Manages local groups on a computer.net localgroup Administrators username /addnet share: Displays or configures shared resources on a computer.net sharenet use: Connects or disconnects a computer from shared resources or map network drives.net use Z: \\server\share /user:username passwordnetstat: Displays active network connections, routing tables, and network statistics.netstat -anotelnet: Connects to remote computers using the Telnet protocol.telnet example.com 80regedit: Opens the Windows Registry Editor for viewing and editing the Windows Registry.regeditgpupdate: 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 /rassoc: Displays or modifies file extension associations.assoc .txtftype: Displays or modifies file types used in file extension associations.ftype txtfilehostname: Displays the name of the current host (computer) on the network.hostnameschtasks: Schedules commands and programs to run periodically or at a specific time.schtasks /create /tn "TaskName" /tr "TaskRun" /sc daily /st 12:00xcopy: An extended copy utility used for copying multiple files or entire directory trees from one directory to another.xcopy source destination /Eexpand: Extracts files from compressed .cab cabinet files.expand source.cab -F:* destinationpnputil: Manages the driver package repository on a local or remote computer.pnputil -i -a driver.infbcdboot: 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 Applicationslmgr: 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.