The Command Prompt is a command line interpreter (CLI) for automating tasks with scripts.

Navigation

The cd command changes the directory.

To change the drive, type the drive letter with :, like D:.

Unlike ls in Linux, dir is used to show files

Basic Commands

CommandDescription
mkdir <foulder>Make a new directory
copy <source> <destination>Copy files to a new location
robocopy <source> <destination> /SCopy directory and subdirectories excluding empty
robocopy <source> <destination> /ECopy subdirectories with empty directories
move <source> <destination>Move files, including directories
del <file>Delete file
rmdir <directory>Deletes empty directory
rmdir /S <directory>Deletes directory and contents
more <file>Display content of file page by page
find <directory> "<text>" 2>nullSearches inside files for text and hide errors
where <file>Locates file on computer

Networking

CommandDescription
ipconfigCheck network settings
netsh interface ip set address <connection> static <IP> <subnet> <gateway>Set IP address
net use <drive>: <shared drive>Mount shared drive to specified drive
net use <drive>: /deleteRemoves specified drive

User Management

CommandDescription
net userDisplay current users
net user /add <username> <password>Add new user (Put * for password to hide it)
net user /delete <username>Delete user
net user <username>Check user groups
net localgroup <group_name> /add <username>Add user to group