The Windows operating system features over 280 commands for CMD (Command Prompt). Some commands are specific to Windows servers, while others are available for desktop versions. In both cases, CMD commands communicate directly with the OS and allow to perform various IT automation tasks.
- Use: Displays a list of files and directories in the current directory.
- Use: Changes the current directory.
- Use: Clears the command prompt screen.
- Use: Creates a new directory.
- Use: Removes an empty directory.
- Use: Renames a file or directory.
- Use: Displays messages or turns command echoing on/off.
- File Creation Example: Create a new file and add text:
echo Your content goes here > C:\path\to\folder\filename.txt
- File Creation (Empty):
echo. > C:\path\to\folder\filename.txt
- Use: Displays the contents of a text file.
type C:\path\to\folder\filename.txt
- Use: Copies files from one location to another.
copy C:\path\to\source\file.txt C:\path\to\folder\file.txt
- Use: Deletes one or more files.
del C:\path\to\folder\filename.txt
- Use: Moves files from one directory to another.
move C:\path\to\folder\file1.txt C:\path\to\new\folder
- Use: Copies files and directories, including subdirectories.
xcopy C:\path\to\folder\ C:\path\to\destination\ /s /e
- Use: Displays network configuration information.
- Use: Tests network connectivity to a remote system.
- Use: Displays active network connections and listening ports.
- Use: Displays a list of currently running processes.
- Use: Terminates a running process.
- Use: Checks the disk for errors and repairs them.
- Use: Scans and repairs system files.
- Use: Shuts down or restarts the computer.
- Use: Displays detailed system information.
- Use: Displays or sets the system time.
- Use: Displays or sets the system date.
- Use: Displays or modifies user accounts.
- Use: Starts a network service.
- Use: Stops a network service.
- Use: Displays the computer's hostname.
- Use: Displays the directory structure of a drive or path.
- Use: Displays or changes file attributes.
- Use: Compares two files and displays differences.