Commands in windows command line

Command Line Commands – CLI Tutorial

The Windows command line is one of the most powerful utilities on a Windows PC. With it, you can interact with the OS directly and do a lot of things not available in the graphical user interface (GUI).

In this article, I’ll show you 40 commands you can use on the Windows command line that can boost your confidence as a Windows user.

N.B.: You have to be careful while using the commands I’ll show you. This is because some commands can have a lasting negative or positive effect on your Windows PC until you reset it.

In addition, some of these commands require you to open the command prompt as an admin.
ss5-1

powershell start cmd -v runAs – Run the Command Prompt as an Administrator

Entering this command opens another command prompt window as an administrator:
ss1-1

driverquery – Lists All Installed Drivers

It is important to have access to all drivers because they often cause problems.

That’s what this command does – it shows you even the drivers you won’t find in the device manager.
ss2-1

chdir or cd – Changes the Current Working Directory to the Specified Directory

ss3-1

systeminfo – Shows Your PC’s Details

If you want to see more detailed information about your system you won’t see in the GUI, this is the command for you.
ss4-1

set – Shows your PC’s Environment Variables

ss5-2

prompt – Changes the Default Text Shown before Entering Commands

By default, the command prompt shows the C drive path to your user account.

You can use the prompt command to change that default text with the syntax prompt prompt_name $G:
ss6-1

N.B: If you don’t append $G to the command, you won’t get the greater than symbol in front of the text.

clip – Copies an Item to the Clipboard

For example, dir | clip copies all the content of the present working directory to the clipboard.
ss7

You can type clip /? and hit ENTER to see how to use it.

assoc – Lists Programs and the Extensions They are Associated With

ss8

title – Changes the Command Prompt Window Title Using the Format title window-title-name

ss9

fc – Compares Two Similar Files

If you are a programmer or writer and you want to quickly see what differs between two files, you can enter this command and then the full path to the two files. For example fc “file-1-path” “file-2-path”.
ss10

cipher – Wipes Free Space and Encrypts Data

On a PC, deleted files remain accessible to you and other users. So, technically, they are not deleted under the hood.

You can use the cipher command to wipe the drive clean and encrypt such files.
ss11

netstat -an – Shows Open Ports, their IP Addresses and States

ss12

ping – Shows a Website IP Address, Lets you Know How Long it Takes to Transmit Data and a Get Response

ss13

color – Changes the Text Color of the Command Prompt

Enter color attr to see the colors you can change to:
ss14

Entering color 2 changes the color of the terminal to green:
ss15

for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear – Shows All Wi-Fi Passwords

ss16

ipconfig – Shows Information about PC IP Addresses and Connections

ss17

This command also has extensions such as ipconfig /release, ipconfig /renew, and ipconfig /flushdns which you can use to troubleshoot issues with internet connections.

sfc – System File Checker

This command scans your computer for corrupt files and repairs them. The extension of the command you can use to run a scan is /scannow.
ss18

powercfg – Controls Configurable Power Settings

You can use this command with its several extensions to show information about the power state of your PC.

You can enter powercfg help to show those extensions.
ss19

For example, you can use powercfg /energy to generate a battery health report.
ss20

The powercfg /energy command will generate an HTML file containing the report. You can find the HTML file in C:Windowssystem32energy-report.html.

dir – Lists Items in a Directory

ss21

del – Deletes a File

ss22

attrib +h +s +r folder_name – Hides a Folder

You can hide a folder right from the command line by typing in attrib +h +s +r folder_name and then pressing ENTER.

To show the folder again, execute the command – attrib -h -s -r folder_name.
ss23

start website-address – Logs on to a Website from the Command Line

ss24
ss25

tree – Shows the Tree of the Current Directory or Specified Drive

ss26

ver – Shows the Version of the OS

ss27

tasklist – Shows Open Programs

You can do the same thing you do with the task manager with this command:
ss28
The next command shows you how to close an open task.

taskkill – Terminates a Running Task

To kill a task, run taskkill /IM "task.exe" /F. For example, taskkill /IM "chrome.exe" /F:
ss29

date – Shows and Changes the Current Date

ss30

time – Shows and Changes the Current Time

ss31

vol – Shows the Serial Number and Label Info of the Current Drive

ss32

dism – Runs the Deployment Image Service Management Tool

ss33

CTRL + C – Stops the Execution of a Command

-help – Provides a Guide to other Commands

For example, powercfg -help shows how to use the powercfg command
ss34

echo – Shows Custom Messages or Messages from a Script or File

ss35

You can also use the echo command to create a file with this syntax echo file-content > filename.extension.
ss36

mkdir – Creates a Folder

ss37

rmdir – Deletes a Folder

ss38

N.B.: The folder must be empty for this command to work.

more – Shows More Information or the Content of a File

ss39

move – Moves a File or Folder to a Specified Folder

ss40

ren – Renames a File with the Syntax ren filename.extension new-name.extension

ss41-1

cls – Clears the Command Line

In case you enter several commands and the command line gets clogged up, you can use cls to clear all entries and their outputs.
cls

exit – Closes the Command Line

shutdown – Shuts down, Restarts, Hibernates, Sleeps the Computer

You can shut down, restart, hibernate, and sleep your PC from the command line.

Enter shutdown in the command line so you can see the extensions you can use to perform the actions. For example, shutdown /r will restart your computer.
ss42

Conclusion

This article showed you several “unknown-to-many” commands you can use to get access to hidden functionalities on your Windows PC.

Again, you should be careful while working with these commands because they can have a lasting effect on your OS.

If you find the commands helpful, share the article with your friends and family.

In case you know another useful command I did not list, tell me about it on Twitter. I will add it and mention you as the source.



Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Command Description Append The append command can be used by programs to open files in another directory as if they were located in the current directory. The append command is available in MS-DOS as well as in all 32-bit versions of Windows. The append command is not available in 64-bit versions of Windows. Arp The arp command is used to display or change entries in the ARP cache. The arp command is available in all versions of Windows. Assoc The assoc command is used to display or change the file type associated with a particular file extension. The assoc command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. At The at command is used to schedule commands and other programs to run at a specific date and time. The at command is available in Windows 7, Windows Vista, and Windows XP. Beginning in Windows 8, command line task scheduling should instead be completed with the schtasks command. Atmadm The atmadm command is used to display information related to asynchronous transfer mode (ATM) connections on the system. The atmadm command is available in Windows XP. Support for ATM was removed beginning in Windows Vista, making the atmadm command unnecessary. Attrib The attrib command is used to change the attributes of a single file or a directory. The attrib command is available in all versions of Windows, as well as in MS-DOS. Auditpol The auditpol command is used to display or change audit policies. The auditpol command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Bcdboot The bcdboot command is used to copy boot files to the system partition and to create a new system BCD store. The bcdboot command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Bcdedit The bcdedit command is used to view or make changes to Boot Configuration Data. The bcdedit command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. The bcdedit command replaced the bootcfg command beginning in Windows Vista. Bdehdcfg The bdehdcfg command is used to prepare a hard drive for BitLocker Drive Encryption. The bdehdcfg command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Bitsadmin The bitsadmin command is used to create, manage, and monitor download and upload jobs. The bitsadmin command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. While the bitsadmin command is available in those versions of Windows, it is being phased out—the BITS PowerShell cmdlets should be used instead. Bootcfg The bootcfg command is used to build, modify, or view the contents of the boot.ini file, a hidden file that is used to identify in what folder, on which partition, and on which hard drive Windows is located. The bootcfg command is available in Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The bootcfg command was replaced by the bcdedit command beginning in Windows Vista. Bootcfg is still available in Windows 10, 8, 7, and Vista, but it serves no real value since boot.ini is not used in these operating systems. Bootsect The bootsect command is used to configure the master boot code to one compatible with BOOTMGR (Vista and later) or NTLDR (XP and earlier). The bootsect command is available in Windows 11, Windows 10, and Windows 8. The bootsect command is also available in Windows 7 and Windows Vista but only from the Command Prompt available in System Recovery Options. Break The break command sets or clears extended CTRL+C checking on DOS systems. The break command is available in all versions of Windows, as well as in MS-DOS. The break command is available in Windows XP and later versions of Windows to provide compatibility with MS-DOS files but it has no effect in Windows itself. Cacls The cacls command is used to display or change access control lists of files. The cacls command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The cacls command is being phased out in favor of the icacls command, which should be used instead in all versions of Windows after Windows XP. Call The call command is used to run a script or batch program from within another script or batch program. The call command is available in all versions of Windows, as well as in MS-DOS. The call command has no effect outside of a script or batch file. In other words, running the call command at the Command Prompt or MS-DOS prompt will do nothing. Cd The cd command is the shorthand version of the chdir command. The cd command is available in all versions of Windows, as well as in MS-DOS. Certreq The certreq command is used to perform various certification authority (CA) certificate functions. The certreq command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Certutil The certutil command is used to dump and display certification authority (CA) configuration information in addition to other CA functions. The certutil command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Change The change command changes various terminal server settings like install modes, COM port mappings, and logons. The change command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Chcp The chcp command displays or configures the active code page number. The chcp command is available in all versions of Windows, as well as in MS-DOS. Chdir The chdir command is used to display the drive letter and folder that you are currently in. Chdir can also be used to change the drive and/or directory that you want to work in. The chdir command is available in all versions of Windows, as well as in MS-DOS. Checknetisolation The checknetisolation command is used to test apps that require network capabilities. The checknetisolation command is available in Windows 11, Windows 10, and Windows 8. Chglogon The chglogon command enables, disables, or drains terminal server session logins. The chglogon command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Executing the chglogon command is the same as executing change logon. Chgport The chgport command can be used to display or change COM port mappings for DOS compatibility. The chgport command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Executing the chgport command is the same as executing change port. Chgusr The chgusr command is used to change the install mode for the terminal server. The chgusr command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Executing the chgusr command is the same as executing change user. Chkdsk The chkdsk command, often referred to as check disk, is used to identify and correct certain hard drive errors. The chkdsk command is available in all versions of Windows, as well as in MS-DOS. Chkntfs The chkntfs command is used to configure or display the checking of the disk drive during the Windows boot process. The chkntfs command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Choice The choice command is used within a script or batch program to provide a list of choices and return the value of that choice to the program. The choice command is available in MS-DOS and all versions of Windows except Windows XP. Use the set command with the /p switch in place of the choice command in batch files and scripts that you plan to use in Windows XP. Cipher The cipher command shows or changes the encryption status of files and folders on NTFS partitions. The cipher command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Clip The clip command is used to redirect the output from any command to the clipboard in Windows. The clip command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Cls The cls command clears the screen of all previously entered commands and other text. The cls command is available in all versions of Windows, as well as in MS-DOS. Cmd The cmd command starts a new instance of the cmd.exe command interpreter. The cmd command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Cmdkey The cmdkey command is used to show, create, and remove stored user names and passwords. The cmdkey command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Cmstp The cmstp command installs or uninstalls a Connection Manager service profile. The cmstp command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Color The color command is used to change the colors of the text and background within the Command Prompt window. The color command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Command The command command starts a new instance of the command.com command interpreter. The command command is available in MS-DOS as well as in all 32-bit versions of Windows. The command command is not available in 64-bit versions of Windows. Comp The comp command is used to compare the contents of two files or sets of files. The comp command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Compact The compact command is used to show or change the compression state of files and directories on NTFS partitions. The compact command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Convert The convert command is used to convert FAT or FAT32 formatted volumes to the NTFS format. The convert command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Copy The copy command does simply that — it copies one or more files from one location to another. The copy command is available in all versions of Windows, as well as in MS-DOS. The xcopy command is considered to be a more «powerful» version of the copy command. Cscript The cscript command is used to execute scripts via Microsoft Script Host. The cscript command is available in all versions of Windows. The cscript command is most popularly used to manage printers from the command line using scripts like prncnfg.vbs, prndrvr.vbs, prnmngr.vbs, and others. Ctty The ctty command is used to change the default input and output devices for the system. The ctty command is available in Windows 98 and 95 as well as in MS-DOS. The functions provided by the ctty command were no longer necessary beginning in Windows XP because the command.com interpreter (MS-DOS) is no longer the default command line interpreter. Date The date command is used to show or change the current date. The date command is available in all versions of Windows, as well as in MS-DOS. Dblspace The dblspace command is used to create or configure DoubleSpace compressed drives. The dblspace command is available in Windows 98 and 95, as well as in MS-DOS. DriveSpace, executed using the drvspace command, is an updated version of DoubleSpace. Windows began handling compression beginning in Windows XP. Debug The debug command starts Debug, a command line application used to test and edit programs. The debug command is available in MS-DOS as well as in all 32-bit versions of Windows. The debug command is not available in 64-bit versions of Windows. Defrag The defrag command is used to defragment a drive you specify. The defrag command is the command line version of Microsoft’s Disk Defragmenter. The defrag command is available in all versions of Windows, as well as in MS-DOS. Del The del command is used to delete one or more files. The del command is available in all versions of Windows, as well as in MS-DOS. The del command is the same as the erase command. Deltree The deltree command is used to delete a directory and all the files and subdirectories within it. The deltree command is available in Windows 98 and 95, as well as in MS-DOS. Beginning in Windows XP, a folder and its files and subfolders can be removed using the /s function of the rmdir command. Deltree was no longer needed with this new rmdir ability so the command was removed. Diantz The diantz command is used to losslessly compress one or more files. The diantz command is sometimes called Cabinet Maker. The diantz command is available in Windows 7, Windows Vista, and Windows XP. The diantz command is the same as the makecab command. Dir The dir command is used to display a list of files and folders contained inside the folder that you are currently working in. The dir command also displays other important information like the hard drive’s serial number, the total number of files listed, their combined size, the total amount of free space left on the drive, and more. The dir command is available in all versions of Windows, as well as in MS-DOS. Diskcomp The diskcomp command is used to compare the contents of two floppy disks. The diskcomp command is available in all versions of Windows, as well as in MS-DOS, with the exclusion of Windows 11 and Windows 10. Diskcopy The diskcopy command is used to copy the entire contents of one floppy disk to another. The diskcopy command is available in all versions of Windows, as well as in MS-DOS, with the exclusion of Windows 11 and Windows 10. Diskpart The diskpart command is used to create, manage, and delete hard drive partitions. The diskpart command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The diskpart command replaced the fdisk command beginning in Windows XP. Diskperf The diskperf command is used to manage disk performance counters remotely. The diskperf command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Diskraid The diskraid command starts the DiskRAID tool which is used to manage and configure RAID arrays. The diskraid command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Dism The dism command starts the Deployment Image Servicing and Management tool (DISM). The DISM tool is used to manage features in Windows images. The dism command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Dispdiag The dispdiag command is used to output a log of information about the display system. The dispdiag command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Djoin The djoin command is used to create a new computer account in a domain. The djoin command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Doskey The doskey command is used to edit command lines, create macros, and recall previously entered commands. The doskey command is available in all versions of Windows, as well as in MS-DOS. Dosshell The dosshell command starts DOS Shell, a graphical file management tool for MS-DOS. The dosshell command is available in Windows 95 (in MS-DOS mode) and also in MS-DOS version 6.0 and later MS-DOS versions that were upgraded from previous versions that contained the dosshell command. A graphical file manager, Windows Explorer, became an integrated part of the operating system beginning in Windows 95. Dosx The dosx command is used to start DOS Protected Mode Interface (DPMI), a special mode designed to give MS-DOS applications access to more than the normally allowed 640 KB. The dosx command is available in Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The dosx command is not available in 64-bit versions of Windows. The dosx command and DPMI is only available in Windows to support older MS-DOS programs. Driverquery The driverquery command is used to show a list of all installed drivers. The driverquery command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Drvspace The drvspace command is used to create or configure DriveSpace compressed drives. The drvspace command is available in Windows 98 and 95, as well as in MS-DOS. DriveSpace is an updated version of DoubleSpace, executed using the dblspace command. Windows began handling compression beginning in Windows XP. Echo The echo command is used to show messages, most commonly from within script or batch files. The echo command can also be used to turn the echoing feature on or off. The echo command is available in all versions of Windows, as well as in MS-DOS. Edit The edit command starts the MS-DOS Editor tool which is used to create and modify text files. The edit command is available in MS-DOS as well as in all 32-bit versions of Windows. The edit command is not available in 64-bit versions of Windows. Edlin The edlin command starts the Edlin tool which is used to create and modify text files from the command line. The edlin command is available in all 32-bit versions of Windows but is not available in 64-bit versions of Windows. In MS-DOS, the edlin command is only available up to MS-DOS 5.0, so unless your later version of MS-DOS was upgraded from 5.0 or prior, you won’t see the edlin command. Emm386 The emm386 command is used to give MS-DOS access to more than 640 KB of memory (RAM). The emm386 command is available in Windows 98 and 95, as well as in MS-DOS. Windows itself has access to extended and expanded memory beginning in Windows 95. Endlocal The endlocal command is used to end the localization of environment changes inside a batch or script file. The endlocal command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Erase The erase command is used to delete one or more files. The erase command is available in all versions of Windows, as well as in MS-DOS. The erase command is the same as the del command. Esentutl The esentutl command is used to manage Extensible Storage Engine databases. The esentutl command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Eventcreate The eventcreate command is used to create a custom event in an event log. The eventcreate command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Eventtriggers The eventtriggers command is used to configure and display event triggers. The eventtriggers command is available in Windows XP. Beginning in Windows Vista, event triggers are created using the Attach Task To This Event feature in Event Viewer, making the eventtriggers command unnecessary. Exe2bin The exe2bin command is used to convert a file of the EXE file type (executable file) to a binary file. The exe2bin command is available in 32-bit versions of Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The exe2bin command is not available in any 64-bit version of Windows. Exit The exit command is used to end the cmd.exe (Windows) or command.com (MS-DOS) session that you’re currently working in. The exit command is available in all versions of Windows, as well as in MS-DOS. Expand The expand command is used to extract the files and folders contained in Microsoft Cabinet (CAB) files. The expand command is available in MS-DOS as well as in all versions of Windows. The expand command is not available in the 64-bit version of Windows XP. Extrac32 The extrac32 command is used to extract the files and folders contained in Microsoft Cabinet (CAB) files. The extrac32 command is available in all versions of Windows. The extrac32 command is actually a CAB extraction program for use by Internet Explorer but can be used to extract any Microsoft Cabinet file. Use the expand command instead of the extrac32 command if possible. Extract The extract command is used to extract the files and folders contained in Microsoft Cabinet (CAB) files. The extract command is available in Windows 98 and 95. The extract command was replaced by the expand command beginning in Windows XP. Fasthelp The fasthelp command provides more detailed information on any of the other MS-DOS commands. The fasthelp command is only available in MS-DOS. The help command replaced the fasthelp command beginning in Windows 95. Fastopen The fastopen command is used to add a program’s hard drive location to a special list stored in memory, potentially improving the program’s launch time by removing the need for MS-DOS to locate the application on the drive. The fastopen command is available in MS-DOS as well as in all 32-bit versions of Windows. The fastopen command is not available in 64-bit versions of Windows. Fastopen is only available in Windows 10, Windows 8, 7, Vista, and XP to support older MS-DOS files. Fc The fc command is used to compare two individual or sets of files and then show the differences between them. The fc command is available in all versions of Windows, as well as in MS-DOS. Fdisk The fdisk command is used to create, manage, and delete hard drive partitions. The fdisk command is available in Windows 98 and 95, as well as in MS-DOS. The fdisk command was replaced by the diskpart command beginning in Windows XP. Partition management is also available from Disk Management in Windows 11, 10, 8, 7, Vista, and XP. Find The find command is used to search for a specified text string in one or more files. The find command is available in all versions of Windows, as well as in MS-DOS. Findstr The findstr command is used to find text string patterns in one or more files. The findstr command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Finger The finger command is used to return information about one or more users on a remote computer that’s running the Finger service. The finger command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Fltmc The fltmc command is used to load, unload, list, and otherwise manage Filter drivers. The fltmc command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Fondue The fondue command, short for Features on Demand User Experience Tool, is used to install any of the several optional Windows features from the command line. The fondue command is available in Windows 11, Windows 10, and Windows 8. Optional Windows features can also be installed from the Programs and Features applet in Control Panel. For The for command is used to run a specified command for each file in a set of files. The for command is most often used within a batch or script file. The for command is available in all versions of Windows, as well as in MS-DOS. Forcedos The forcedos command is used to start the specified program in the MS-DOS subsystem. The forcedos command is only available in 32-bit versions of Windows XP. The forcedos command is only used for MS-DOS programs that are not recognized as such by Windows XP. Forfiles The forfiles command selects one or more files to execute a specified command on. The forfiles command is most often used within a batch or script file. The forfiles command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Format The format command is used to format a drive in the file system that you specify. The format command is available in all versions of Windows, as well as in MS-DOS. Drive formatting is also available from Disk Management in Windows 11, 10, 8, 7, Vista, and XP. Fsutil The fsutil command is used to perform various FAT and NTFS file system tasks like managing reparse points and sparse files, dismounting a volume, and extending a volume. The fsutil command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Ftp The ftp command can be used to transfer files to and from another computer. The remote computer must be operating as an FTP server. The ftp command is available in all versions of Windows. Ftype The ftype command is used to define a default program to open a specified file type. The ftype command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Getmac The getmac command is used to display the media access control (MAC) address of all the network controllers on a system. The getmac command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Goto The goto command is used in a batch or script file to direct the command process to a labeled line in the script. The goto command is available in all versions of Windows, as well as in MS-DOS. Gpresult The gpresult command is used to display Group Policy settings. The gpresult command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Gpupdate The gpupdate command is used to update Group Policy settings. The gpupdate command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Graftabl The graftabl command is used to enable the ability of Windows to display an extended character set in graphics mode. The graftabl command is available in all versions of Windows and in MS-DOS up to version 5.0. The graftabl command is not available in 64-bit versions of Windows. Graphics The graphics command is used to load a program that can print graphics. The graphics command is available in MS-DOS as well as in all 32-bit versions of Windows. The graphics command is not available in 64-bit versions of Windows. Help The help command provides more detailed information on any of the other Command Prompt or MS-DOS commands. The help command is available in all versions of Windows, as well as in MS-DOS. Hostname The hostname command displays the name of the current host. The hostname command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Hwrcomp The hwrcomp command is used to compile custom dictionaries for handwriting recognition. The hwrcomp command is available in Windows 8 and Windows 7. Hwrreg The hwrreg command is used to install a previously compiled custom dictionary for handwriting recognition. The hwrreg command is available in Windows 8 and Windows 7. Icacls The icacls command is used to display or change access control lists of files. The icacls command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. The icacls command is an updated version of the cacls command. If The if command is used to perform conditional functions in a batch file. The if command is available in all versions of Windows, as well as in MS-DOS. Interlnk The interlnk command is used to connect two computers via a serial or parallel connection to share files and printers. The interlnk command is only available in MS-DOS. The ability to directly connect two computers is handled by the networking functions in all versions of Windows. Intersvr The intersvr command is used to start the Interlnk server and to copy Interlnk files from one computer to another. The intersvr command is only available in MS-DOS. The ability to directly connect two computers is handled by the networking functions in all versions of Windows. Ipconfig The ipconfig command is used to display detailed IP information for each network adapter utilizing TCP/IP. The ipconfig command can also be used to release and renew IP addresses on systems configured to receive them via a DHCP server. The ipconfig command is available in all versions of Windows. Ipxroute The ipxroute command is used to display and change information about IPX routing tables. The ipxroute command is available in Windows XP. Microsoft removed their built-in NetWare client beginning in Windows Vista, removing the associated ipxroute command as well. Irftp The irftp command is used to transmit files over an infrared link. The irftp command is available in Windows 8, Windows 7, and Windows Vista. Iscsicli The iscsicli command starts the Microsoft iSCSI Initiator, used to manage iSCSI. The iscsicli command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Kb16 The kb16 command is used to support MS-DOS files that need to configure a keyboard for a specific language. The kb16 command is available in Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The kb16 command is not available in 64-bit versions of Windows. The kb16 command replaced the keyb command beginning in Windows XP but only exists to support older MS-DOS files. Keyb The keyb command is used to configure a keyboard for a specific language. The keyb command is available in Windows 98 and 95, as well as in MS-DOS. See the kb16 command for an equivalent command in later versions of Windows. Keyboard language settings are handled by the Region and Language or Regional and Language Options (depending on the version of Windows) Control Panel applets in Windows beginning in Windows XP. Klist The klist command is used to list Kerberos service tickets. The klist command can also be used to purge Kerberos tickets. The klist command is available in Windows 11, Windows 10, Windows 8 and Windows 7. Ksetup The ksetup command is used to configure connections to a Kerberos server. The ksetup command is available in Windows 11, Windows 10, Windows 8 and Windows 7. Ktmutil The ktmutil command starts the Kernel Transaction Manager utility. The ktmutil command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Label The label command is used to manage the volume label of a disk. The label command is available in all versions of Windows, as well as in MS-DOS. Lh The lh command is the shorthand version of the loadhigh command. The lh command is available in Windows 98 and 95, as well as in MS-DOS. Licensingdiag The licensingdiag command is a tool used to generate a text-based log and other data files that contain product activation and other Windows licensing information. The licensingdiag command is available in Windows 11, Windows 10, and Windows 8. Loadfix The loadfix command is used to load the specified program in the first 64K of memory and then runs the program. The loadfix command is available in MS-DOS as well as in all 32-bit versions of Windows. The loadfix command is not available in 64-bit versions of Windows. Loadhigh The loadhigh command is used to load a program into high memory and is usually used from within the autoexec.bat file. The loadhigh command is available in Windows 98 and 95, as well as in MS-DOS. Memory usage is handled automatically beginning in Windows XP. Lock The lock command is used to lock a drive, enabling direct disk access for a program. The lock command is only available in Windows 98 and 95. Drive locking is no longer available as of Windows XP. Lodctr The lodctr command is used to update registry values related to performance counters. The lodctr command is available in all versions of Windows. Logman The logman command is used to create and manage Event Trace Session and Performance logs. The logman command also supports many functions of Performance Monitor. The logman command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Logoff The logoff command is used to terminate a session. The logoff command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Lpq The lpq command displays the status of a print queue on a computer running Line Printer Daemon (LPD). The lpq command is available in all versions of Windows. The lpq command is not available by default in Windows 11, 10, 8, 7, or Vista, but can be enabled by turning on the LPD Print Service and LPR Port Monitor features from Programs and Features in Control Panel. Lpr The lpr command is used to send a file to a computer running Line Printer Daemon (LPD). The lpr command is available in all versions of Windows. The lpr command is not available by default in Windows 11, 10, 8, 7, or Vista, but can be enabled by turning on the LPD Print Service and LPR Port Monitor features from Programs and Features in Control Panel. Makecab The makecab command is used to losslessly compress one or more files. The makecab command is sometimes called Cabinet Maker. The makecab command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The makecab command is the same as the diantz command, a command that was removed after Windows 7. Manage-bde The manage-bde command is used to configure BitLocker Drive Encryption from the command line. The manage-bde command is available in Windows 11, Windows 10, Windows 8, and Windows 7. A script by the name of manage-bde.wsf exists in Windows Vista and can be used with the cscript command to perform BitLocker tasks from the command line in that operating system. Md The md command is the shorthand version of the mkdir command. The md command is available in all versions of Windows, as well as in MS-DOS. Mem The mem command shows information about used and free memory areas and programs that are currently loaded into memory in the MS-DOS subsystem. The mem command is available in MS-DOS as well as in all 32-bit versions of Windows. The mem command is not available in 64-bit versions of Windows. Memmaker The memmaker command is used to start MemMaker, a memory optimization tool. The memaker command is available in Windows 98 and 95, as well as in MS-DOS. Memory usage is automatically optimized beginning in Windows XP. Mkdir The mkdir command is used to create a new folder. The mkdir command is available in all versions of Windows, as well as in MS-DOS. Mklink The mklink command is used to create a symbolic link. The mklink command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Mode The mode command is used to configure system devices, most often COM and LPT ports. The mode command is available in all versions of Windows, as well as in MS-DOS. Mofcomp The mofcomp command properly displays the data within a Managed Object Format (MOF) file. The mofcomp command is available in all versions of Windows. More The more command is used to display the information contained in a text file. The more command can also be used to paginate the results of any other Command Prompt or MS-DOS command. The more command is available in all versions of Windows, as well as in MS-DOS. Mount The mount command is used to mount Network File System (NFS) network shares. The mount command is available in Windows 7 and Windows Vista. The mount command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. The mount command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Mountvol The mountvol command is used to display, create, or remove volume mount points. The mountvol command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Move The move command is used to move one or files from one folder to another. The move command is also used to rename directories. The move command is available in all versions of Windows, as well as in MS-DOS. Mrinfo The mrinfo command is used to provide information about a router’s interfaces and neighbors. The mrinfo command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Msav The msav command starts Microsoft Antivirus. The msav command is only available in MS-DOS. Microsoft Antivirus was designed for MS-DOS and Windows 3.x only. Microsoft provides an optional virus protection suite called Microsoft Security Essentials for Windows XP and later operating systems, and third party antivirus tools are available for all versions of Windows. Msbackup The msbackup command starts Microsoft Backup, a tool used to back up and restore one or more files. The msbackup command is only available in MS-DOS. The msbackup command was replaced with Microsoft Backup beginning in Windows 95 and then Backup and Restore in later versions of Windows. Mscdex The mscdex command is used to provide CD-ROM access to MS-DOS. The mscdex command is available in Windows 98 and 95, as well as in MS-DOS. Windows provides access to CD-ROM drives for the MS-DOS subsystem beginning in Windows XP, so the mscdex command is unnecessary in this and later operating systems. Msd The msd command starts Microsoft Diagnostics, a system information tool. The msd command is only available in MS-DOS. The msd command was replaced with System Information beginning in Windows 95. Msg The msg command is used to send a message to a user. The msg command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Msiexec The msiexec command is used to start Windows Installer, a tool used to install and configure software. The msiexec command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Muiunattend The muiunattend command starts the Multilanguage User Interface unattended setup process. The muiunattend command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Nbtstat The nbtstat command is used to show TCP/IP information and other statistical information about a remote computer. The nbtstat command is available in all versions of Windows. Net The net command is used to display, configure, and correct a wide variety of network settings. The net command is available in all versions of Windows. Net1 The net1 command is used to display, configure, and correct a wide variety of network settings. The net1 command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The net command should be used instead of the net1 command. The net1 command was made available in Windows NT and Windows 2000 as a temporary fix for a Y2K issue that the net command had, which was corrected before the release of Windows XP. The net1 command remains in later versions of Windows only for compatibility with older programs and scripts that utilized the command. Netcfg The netcfg command is used to install the Windows Preinstallation Environment (WinPE), a lightweight version of Windows used to deploy workstations. The netcfg command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Netsh The netsh command is used to start Network Shell, a command-line utility used to manage the network configuration of the local, or a remote, computer. The netsh command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Netstat The netstat command is most commonly used to display all open network connections and listening ports. The netstat command is available in all versions of Windows. Nfsadmin The nfsadmin command is used to manage Server for NFS or Client for NFS from the command line. The nfsadmin command is available in Windows 7 and Windows Vista. The nfsadmin command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. The nfsadmin command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Nlsfunc The nlsfunc command is used to load information specific to a particular country or region. The nlsfunc command is available in MS-DOS as well as in all 32-bit versions of Windows. The nlsfunc command is not available in 64-bit versions of Windows. Nlsfunc is only available in Windows 10, 8, 7, Vista, and XP to support older MS-DOS files. Nltest The nltest command is used to test secure channels between Windows computers in a domain and between domain controllers that are trusting other domains. The nltest command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Nslookup The nslookup is most commonly used to display the hostname of an entered IP address. The nslookup command queries your configured DNS server to discover the IP address. The nslookup command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Ntbackup The ntbackup command is used to perform various backup functions from the Command Prompt or from within a batch or script file. The ntbackup command is available in Windows XP. The ntbackup command was replaced with the wbadmin beginning in Windows Vista. Ntsd The ntsd command is used to perform certain command line debugging tasks. The ntsd command is available in Windows XP. The ntsd command was removed beginning in Windows Vista due to the addition of dump file support in Task Manager. Ocsetup The ocsetup command starts the Windows Optional Component Setup tool, used to install additional Windows features. The ocsetup command is available in Windows 8, Windows 7, and Windows Vista. Beginning in Windows 8, Microsoft is depreciating the ocsetup command in favor of the dism command. Openfiles The openfiles command is used to display and disconnect open files and folders on a system. The openfiles command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Path The path command is used to display or set a specific path available to executable files. The path command is available in all versions of Windows, as well as in MS-DOS. Pathping The pathping command functions much like the tracert command but will also report information about network latency and loss at each hop. The pathping command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Pause The pause command is used within a batch or script file to pause the processing of the file. When the pause command is used, a «Press any key to continue…» message displays in the command window. The pause command is available in all versions of Windows, as well as in MS-DOS. Pentnt The pentnt command is used to detect floating point division errors in the Intel Pentium chip. The pentnt command is also used to enable floating point emulation and disable floating point hardware. The pentnt command is available in Windows XP. The pentnt command was removed beginning in Windows Vista due to the lack of Intel Pentium CPU use at the time of this operating system release. Ping The ping command sends an Internet Control Message Protocol (ICMP) Echo Request message to a specified remote computer to verify IP-level connectivity. The ping command is available in all versions of Windows. Pkgmgr The pkgmgr command is used to start the Windows Package Manager from the Command Prompt. Package Manager installs, uninstalls, configures, and updates features and packages for Windows. The pkgmgr command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Pnpunattend The pnpunattend command is used to automate the installation of hardware device drivers. The pnpunattend command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Pnputil The pnputil command is used to start the Microsoft PnP Utility, a tool used to install a Plug and Play device from the command line. The pnputil command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Popd The popd command is used to change the current directory to the one most recently stored by the pushd command. The popd command is most often utilized from within a batch or script file. The popd command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Power The power command is used to reduce the power consumed by a computer by monitoring software and hardware devices. The power command is available in Windows 98 and 95, as well as in MS-DOS. The power command was replaced by operating system integrated power management functions beginning in Windows XP. Powercfg The powercfg command is used to manage the Windows power management settings from the command line. The powercfg command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Print The print command is used to print a specified text file to a specified printing device. The print command is available in all versions of Windows, as well as in MS-DOS. Prompt The prompt command is used to customize the appearance of the prompt text in Command Prompt or MS-DOS. The prompt command is available in all versions of Windows, as well as in MS-DOS. Pushd The pushd command is used to store a directory for use, most commonly from within a batch or script program. The pushd command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Pwlauncher The pwlauncher command is used to enable, disable, or show the status of your Windows To Go startup options. The pwlauncher command is available in Windows 11, 10, and 8. Qappsrv The qappsrv command is used to display all Remote Desktop Session Host servers available on the network. The qappsrv command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Qbasic The qbasic command starts QBasic, the MS-DOS based programming environment for the BASIC programming language. The qbasic command is available in Windows 98 and 95, as well as in MS-DOS. The qbasic command is not installed by default with Windows 98 or 95 but is available from the installation disc or disks. Qprocess The qprocess command is used to display information about running processes. The qprocess command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Query The query command is used to display the status of a specified service. The query command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Quser The quser command is used to display information about users currently logged on to the system. The quser command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Qwinsta The qwinsta command is used to display information about open Remote Desktop Sessions. The qwinsta command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Rasautou The rasautou command is used to manage Remote Access Dialer AutoDial addresses. The rasautou command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Rasdial The rasdial command is used to start or end a network connection for a Microsoft client. The rasdial command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Rcp The rcp command is used to copy files between a Windows computer and a system running the rshd daemon. The rcp command is available in Windows 7, Windows Vista, and Windows XP. The rcp command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Subsystem for UNIX-based Applications Windows feature from Programs and Features in Control Panel and then installing the Utilities and SDK for UNIX-based Applications available here for Windows Vista and here for Windows 7. The rcp command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Rd The rd command is the shorthand version of the rmdir command. The rd command is available in all versions of Windows, as well as in MS-DOS. Rdpsign The rdpsign command is used to sign a Remote Desktop Protocol (RDP) file. The rdpsign command is available in Windows 7. Reagentc The reagentc command is used to configure the Windows Recovery Environment (RE). The reagentc command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Recimg The recimg command is used to create a custom refresh image. The recimg command is available in Windows 8. Recover The recover command is used to recover readable data from a bad or defective disk. The recover command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Reg The reg command is used to manage the Windows Registry from the command line. The reg command can perform common registry functions like adding registry keys, exporting the registry, etc. The reg command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Regini The regini command is used to set or change registry permissions and registry values from the command line. The regini command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Register-cimprovider The register-cimprovider command is used to register a Common Information Model (CIM) Provider in Windows. The register-cimprovider command is available in Windows 11, Windows 10, and Windows 8. Regsvr32 The regsvr32 command is used to register a DLL file as a command component in the Windows Registry. The regsvr32 command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Relog The relog command is used to create new performance logs from data in existing performance logs. The relog command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Rem The rem command is used to record comments or remarks in a batch or script file. The rem command is available in all versions of Windows, as well as in MS-DOS. Ren The ren command is the shorthand version of the rename command. The ren command is available in all versions of Windows, as well as in MS-DOS. Rename The rename command is used to change the name of the individual file that you specify. The rename command is available in all versions of Windows, as well as in MS-DOS. Repair-bde The repair-bde command is used to repair or decrypt a damaged drive that’s been encrypted using BitLocker. The repair-bde command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Replace The replace command is used to replace one or more files with one or more other files. The replace command is available in all versions of Windows, as well as in MS-DOS. Reset The reset command, executed as reset session, is used to reset the session subsystem software and hardware to known initial values. The reset command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Restore The restore command is used to restore files that were backed up using the backup command. The restore command is only available in MS-DOS. The backup command was only available up to MS-DOS 5.00 but the restore command was included by default with later versions of MS-DOS to provide a way to restore files that were backed up in previous versions of MS-DOS. Rexec The rexec command is used to run commands on remote computers running the rexec daemon. The rexec command is available in Windows Vista and Windows XP. The rsh command is not available by default in Windows Vista but can be enabled by turning on the Subsystem for UNIX-based Applications Windows feature from Programs and Features in Control Panel and then installing the Utilities and SDK for UNIX-based Applications available here. The rexec command is not available in Windows 7 but can be executed in Windows XP via Windows XP Mode if need be. Rmdir The rmdir command is used to delete an existing or completely empty folder. The rmdir command is available in all versions of Windows, as well as in MS-DOS. Robocopy The robocopy command is used to copy files and directories from one location to another. This command is also called Robust File Copy. The robocopy command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. The robocopy command is superior to both the copy command and the xcopy command because robocopy supports many more options. Route The route command is used to manipulate network routing tables. The route command is available in all versions of Windows. Rpcinfo The rpcinfo command makes a remote procedure call (RPC) to an RPC server and reports what it finds. The rpcinfo command is available in Windows 7 and Windows Vista. The rpcinfo command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. The rpcinfo command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Rpcping The rpcping command is used to ping a server using RPC. The rpcping command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Rsh The rsh command is used to run commands on remote computers running the rsh daemon. The rsh command is available in Windows 7, Windows Vista, and Windows XP. The rsh command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Subsystem for UNIX-based Applications Windows feature from Programs and Features in Control Panel and then installing the Utilities and SDK for UNIX-based Applications available here for Windows Vista and here for Windows 7. The rsh command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Rsm The rsm command is used to manage media resources using Removable Storage. The rsm command is available in Windows Vista and Windows XP. The rsm command was optional in Windows Vista and then removed in Windows 7 due to Removable Storage Manager being removed from the operating system. Search for the rsm command in the C:Windowswinsxs folder in Windows Vista if you’re having trouble executing the command. Runas The runas command is used to execute a program using another user’s credentials. The runas command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Rwinsta The rwinsta command is the shorthand version of the reset session command. The rwinsta command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Sc The sc command is used to configure information about services. The sc command communicates with the Service Control Manager. The sc command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Scandisk The scandisk command is used to start Microsoft ScanDisk, a disk repair program. The scandisk command is available in Windows 98 and 95, as well as in MS-DOS. The scandisk command was replaced by the chkdsk command beginning in Windows XP. Scanreg The scanreg command starts Windows Registry Checker, a basic registry repair program and backup utility. The scanreg command is available in Windows 98 and Windows 95. The functions provided by the scanreg command were no longer necessary beginning in Windows XP due to changes in how the Windows Registry functions. Schtasks The schtasks command is used to schedule specified programs or commands to run at certain times. The schtasks command can be used to create, delete, query, change, run, and end scheduled tasks. The schtasks command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP.​ Sdbinst The sdbinst command is used to deploy customized SDB database files. The sdbinst command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Secedit The secedit command is used to configure and analyze system security by comparing the current security configuration to a template. The secedit command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Set The set command is used to display, enable, or disable environment variables in MS-DOS or from the Command Prompt. The set command is available in all versions of Windows, as well as in MS-DOS. Setlocal The setlocal command is used to start the localization of environment changes inside a batch or script file. The setlocal command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Setspn The setspn command is used to manage the Service Principal Names (SPN) for an Active Directory (AD) service account. The setspn command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Setver The setver command is used to set the MS-DOS version number that MS-DOS reports to a program. The setver command is available in MS-DOS as well as in all 32-bit versions of Windows. The setver command is not available in 64-bit versions of Windows. Setx The setx command is used to create or change environment variables in the user environment or the system environment. The setx command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Sfc The sfc command is used to verify and replace important Windows system files. The sfc command is also referred to as System File Checker or Windows Resource Checker, depending on the operating system. The sfc command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Shadow The shadow command is used to monitor another Remote Desktop Services session. The shadow command is available in Windows 7, Windows Vista, and Windows XP. Share The share command is used to install file locking and file sharing functions in MS-DOS. The share command is available in MS-DOS as well as in all 32-bit versions of Windows. The share command is not available in 64-bit versions of Windows. Share is only available in Windows 10, 8, 7, Vista, and XP to support older MS-DOS files. Shift The shift command is used to change the position of replaceable parameters in a batch or script file. The shift command is available in all versions of Windows, as well as in MS-DOS. Showmount The showmount command is used to display information about NFS mounted file systems. The showmount command is available in Windows 7 and Windows Vista. The showmount command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. The showmount command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Shutdown The shutdown command can be used to shut down, restart, or log off the current system or a remote computer. The shutdown command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Smartdrv The smartdrv command installs and configures SMARTDrive, a disk caching utility for MS-DOS. The smartdrv command is available in Windows 98 and 95, as well as in MS-DOS. Caching is automatic beginning in Windows XP, making the smartdrv command unnecessary. Sort The sort command is used to read data from a specified input, sort that data, and return the results of that sort to the Command Prompt screen, a file, or another output device. The sort command is available in all versions of Windows, as well as in MS-DOS. Start The start command is used to open a new command line window to run a specified program or command. The start command can also be used to start an application without creating a new window. The start command is available in all versions of Windows. Subst The subst command is used to associate a local path with a drive letter. The subst command is a lot like the net use command except a local path is used instead of a shared network path. The subst command is available in all versions of Windows, as well as in MS-DOS. The subst command replaced the assign command beginning with MS-DOS 6.0. Sxstrace The sxstrace command is used to start the WinSxs Tracing Utility, a programming diagnostic tool. The sxstrace command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Sys The sys command is used to copy the MS-DOS system files and command interpreter to a disk. The sys command is available in Windows 98 and 95, as well as in MS-DOS. The sys command is used most often to create a simple bootable disk or hard drive. The necessary system files for Windows are too large to fit on a disk, so the sys command was removed beginning in Windows XP. Systeminfo The systeminfo command is used to display basic Windows configuration information for the local or a remote computer. The systeminfo command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Takeown The takedown command is used to regain access to a file that that an administrator was denied access to when reassigning ownership of the file. The takeown command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Taskkill The taskkill command is used to terminate a running task. The taskkill command is the command line equivalent of ending a process in Task Manager in Windows. The taskkill command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tasklist Displays a list of applications, services, and the Process ID (PID) currently running on either a local or a remote computer. The tasklist command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tcmsetup The tcmsetup command is used to set up or disable the Telephony Application Programming Interface (TAPI) client. The tcmsetup command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Telnet The telnet command is used to communicate with remote computers that use the Telnet protocol. The telnet command is available in all versions of Windows. The telnet command is not available by default in Windows 11, 10, 8, 7, or Vista, but can be enabled by turning on the Telnet Client Windows feature from Programs and Features in Control Panel. Tftp The tftp command is used to transfer files to and from a remote computer that’s running the Trivial File Transfer Protocol (TFTP) service or daemon. The tftp command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The tftp command is not available by default in some versions of Windows, but can be enabled by turning on the TFTP Client Windows feature from Programs and Features in Control Panel. Time The time command is used to show or change the current time. The time command is available in all versions of Windows, as well as in MS-DOS. Timeout The timeout command is typically used in a batch or script file to provide a specified timeout value during a procedure. The timeout command can also be used to ignore keypresses. The timeout command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Title The title command is used to set the Command Prompt window title. The title command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tlntadmn The tlntadmn command is used to administer a local or remote computer running Telnet Server. The tlntadmn command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. The tlntadmn command is not available by default in some versions of Windows, but can be enabled by turning on the Telnet Server Windows feature from Programs and Features in Control Panel. Tpmvscmgr The tpmvscmgr command is used to create and destroy TPM virtual smart cards. The tpmvscmgr command is available in Windows 11, Windows 10, and Windows 8. Tracerpt The tracerpt command is used to process event trace logs or real-time data from instrumented event trace providers. The tracerpt command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tracert The tracert command sends Internet Control Message Protocol (ICMP) Echo Request messages to a specified remote computer with increasing Time to Live (TTL) field values and displays the IP address and hostname, if available, of the router interfaces between the source and destination. The tracert command is available in all versions of Windows. Tree The tree command is used to graphically display the folder structure of a specified drive or path. The tree command is available in all versions of Windows, as well as in MS-DOS. Tscon The tscon command is used to attach a user session to a Remote Desktop session. The tscon command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tsdiscon The tsdiscon command is used to disconnect a Remote Desktop session. The tsdiscon command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tskill The tskill command is used to end the specified process. The tskill command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tsshutdn The tsshutdn command is used to remotely shut down or restart a terminal server. The tsshutdn command is available in Windows XP. The ability to shut down a computer remotely is also available in the more powerful shutdown command, so tsshutdn was removed beginning in Windows Vista. Type The type command is used to display the information contained in a text file. The type command is available in all versions of Windows, as well as in MS-DOS. Typeperf The typerperf command displays performance data in the Command Prompt window or writes the data to specified log file. The typeperf command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Tzutil The tzutil command is used to display or configure the current system’s time zone. The tzutil command can also be used to enable or disable Daylight Saving Time adjustments. The tzutil command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Umount The umount command is used to remove Network File System (NFS) mounted network shares. The umount command is available in Windows 7 and Windows Vista. The umount command is not available by default in Windows Vista or Windows 7 but can be enabled by turning on the Services for NFS Windows feature from Programs and Features in Control Panel. The umount command is not available in Windows 11, 10, or 8 because Service for UNIX (SFU) was discontinued. Undelete The undelete command is used to undo a deletion performed with the MS-DOS delete command. The undelete command is only available in MS-DOS. The undelete command was removed beginning in Windows 95 due to the availability of the Recycle Bin in Windows. Additionally, free file recovery programs are available from third-party software makers. Unformat The unformat command is used to undo the formatting on a drive performed by the MS-DOS format command. The unformat command is only available in MS-DOS. The unformat command was removed beginning in Windows 95 due to file system changes. Unlock The unlock command is used to unlock a drive, disabling direct disk access for a program. The unlock command is only available in Windows 98 and 95. Drive locking is no longer available as of Windows XP. Unlodctr The unlodctr command removes Explain text and Performance counter names for a service or device driver from the Windows Registry. The unlodctr command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Vaultcmd The vaultcmd command is used to create, remove, and show stored credentials. The vaultcmd command is available in Windows 11, Windows 10, Windows 8, and Windows 7. Ver The ver command is used to display the current Windows or MS-DOS version number. The ver command is available in all versions of Windows, as well as in MS-DOS. Verify The verify command is used to enable or disable the ability of Command Prompt, or MS-DOS, to verify that files are written correctly to a disk. The verify command is available in all versions of Windows, as well as in MS-DOS. Vol The vol command shows the volume label and serial number of a specified disk, assuming this information exists. The vol command is available in all versions of Windows, as well as in MS-DOS. Vsafe The vsafe command is used to start VSafe, a basic virus protection system for MS-DOS. The vsafe command is only available in MS-DOS. VSafe was designed for MS-DOS and Windows 3.x only. Microsoft provides an optional virus protection suite called Microsoft Security Essentials for Windows XP and later operating systems, and third-party antivirus tools are available for all versions of Windows. Vssadmin The vssadmin command starts the Volume Shadow Copy Service administrative command line tool which displays current volume shadow copy backups and all installed shadow copy writers and providers. The vssadmin command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. W32tm The w32tm command is used to diagnose issues with Windows Time. The w32tm command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Waitfor The waitfor command is used to send or wait for a signal on a system. The waitfor command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Wbadmin The wbadmin command is used to start and stop backup jobs, display details about a previous backup, list the items within a backup, and report on the status of a currently running backup. The wbadmin command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. The wbadmin command replaced the ntbackup command beginning in Windows Vista. Wecutil The wecutil command is used to manage subscriptions to events that are forwarded from WS-Management supported computers. The wecutil command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Wevtutil The wevtutil command starts the Windows Events Command Line Utility which is used to manage event logs and publishers. The wevtutil command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Where The where command is used to search for files that match a specified pattern. The where command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Whoami The whoami command is used to retrieve user name and group information on a network. The whoami command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Winmgmt The winmgmt command starts the command line version of WMI, a scripting tool in Windows. The winmgmt command is available in all versions of Windows. Winrm The winrm command is used to start the command line version of Windows Remote Management, used to manage secure communications with local and remote computers using web services. The winrm command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Winrs The winrs command is used to open a secure command window with a remote host. The winrs command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Winsat The winsat command starts the Windows System Assessment Tool, a program that assesses various features, attributes, and capabilities of a computer running Windows. The winsat command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Wmic The wmic command starts the Windows Management Instrumentation Command line (WMIC), a scripting interface that simplifies the use of Windows Management Instrumentation (WMI) and systems managed via WMI. The wmic command is available in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP. Wsmanhttpconfig The wsmanhttpconfig command is used to manage aspects of the Windows Remote Management (WinRM) service. The wsmanhttpconfig command is available in Windows 11, Windows 10, Windows 8, Windows 7, and Windows Vista. Xcopy The xcopy command can copy one or more files or directory trees from one location to another. The xcopy command is generally considered a more «powerful» version of the copy command through the robocopy command trumps even xcopy. The xcopy command is available in all versions of Windows, as well as in MS-DOS. A command by the name of xcopy32 existed in Windows 95 and Windows 98. To avoid a long and confusing explanation here, just know that no matter if you executed the xcopy command or the xcopy32 command, you were always executing the most updated version of the command. Xwizard The xwizard command, short for Extensible Wizard, is used to register data in Windows, often from a preconfigured XML file. The xwizard command is available in Windows 11, Windows 10, Windows 8, and Windows 7.

Sometimes you can forget cmd commands in Windows and saving them on your computer or a peace of paper as a cheat sheet is a good practice. This list is not complete but it contains most commonly used commands. Feel free to add your most commonly used commands in the comments below and share the list.

Files and Folders Management

  • COPY — Copies files to another location
  • DIR – Displays files and folders in current directory
  • DEL or ERASE — Deletes files
  • EDIT — Starts file editor
  • CD — Changes directory
  • EXPAND — Decompresses compressed files
  • FC — Compares files and shows the differences between them
  • FIND — Finds a text string in the file
  • MD or MAKEDIR — Creates a folder
  • MOVE — Moves files from one folder to another
  • PRINT — Prints out the text file contents
  • RD or RMDIR — Deletes a folder
  • REN or RENAME — Renames a file or folder
  • REPLACE — Replaces files in one directory with files of the same name in another directory (overwrite)
  • ROBOCOPY — Uses an advanced tool to copy files and directories
  • TREE — Shows directory structure of a disk or folder
  • TYPE — Displays the contents of text files
  • OPENFILES – Manages opened local or network files
  • XCOPY — Copies files and directory trees

Applications and Processes

  • SCHTASKS — Executes a command or start a scheduled application (Task Scheduler)
  • SHUTDOWN — Shutdowns or reboots your computer
  • TASKLIST — Lists the tasks being performed
  • TASKKILL — Stops or halts a task (to stop a task you use a PID which you can find out from TASKLIST)
  • REG – Starts registry editor
  • RUNAS — Launches the task as another user

Disks Management

  • CHKDISK — Checks disk and shows statistics
  • DEFRAG – Starts disk defragmentation
  • CHKNTFS — Displays or changes execution of disk check at boot
  • COMPACT — Displays and change the compression of files in NTFS partitions
  • CONVERT — Converts FAT disk volume to NTFS
  • DISKPART — Displays and adjusts disk partition properties
  • FORMAT — Formats the disk
  • FSUTIL — Displays and configures file system properties
  • LABEL — Creates, changes, or deletes a disk volume label
  • RECOVER — Recovers data from a bad or damaged disk
  • VOL — Displays volume label and serial number for the disk

System Information

  • DATE — Outputs or sets the current date
  • TIME — Displays or sets the system time
  • DRIVERQUERY — Displays the current state and properties of the device driver
  • HOSTNAME — Displays name of the computer
  • SYSTEMINFO — Shows configuration information about your computer
  • VER — Allows you to view the Windows version
  • GPRESULT – Displays current applied group policies (RSoP)
  • GPUPDATE – Updates group policies

Network

  • IPCONFIG — Shows information about network interfaces
  • PING – Sends ICMP requests to the target host, checks host availability
  • TRACERT — Finds the path for packets traveling over the network
  • NSLOOKUP — Finds IP address by resource name
  • ROUTE — Displays network route tables
  • ARP— Shows a table with IP addresses converted into physical addresses
  • NETSH – Starts is a network settings control program
  • GETMAC — Shows the MAC address of the network adapter
  • TFTP – Starts TFTP client in console

Command Line Setup

  • CLS — Clears screen
  • CMD — Displays another command prompt
  • COLOR — Sets the text and background color
  • PROMPT — Changes the command line prompt
  • TITLE — Assigns a title for the current session
  • HELP – Launches CMD help
  • EXIT — Exits the command line

Аverage rating : 4.1

Rated by: 13

1101
CT Amsterdam
The Netherlands, Herikerbergweg 292

+31 20 262-33-82

700
300

ITGLOBAL.COM NL

1101
CT Amsterdam
The Netherlands, Herikerbergweg 292

+31 20 262-33-82

700
300

ITGLOBAL.COM NL

700
300

Contents

  • 1 Windows Command Line
  • 2 Navigating Windows Command Line
  • 3 Windows Command Line Commands
  • 4 Piping Commands
  • 5 Output to a text file
  • 6 Chaining Commands
  • 7 Processes and Performance
  • 8 Controlling Windows Services in Command Line
  • 9 Windows Hard Disk Utils
  • 10 User Control
  • 11 Managing TCP/IP and Networking with WCL
  • 12 More Resources:

Windows Command Line

A simple guide for any skill level.

Windows-command-line.jpg

Windows Command Line, known as a Command Line Interface, can be a very powerful tool for system administrators, power users, and technical support personnel. While most users will never see Windows Command Line, this guide is intended for Intermediate to Advanced users.

Most of Windows Command Line functions can be accessed through Windows GUI, other functions and programs can not. Knowing and understanding Windows Command Line will allow you to complete tasks faster, access features and programs not available in the Windows GUI, and look like you know what you’re doing.

Through this guide, we will walk through each section of commands that Windows XP Command line offers you the capability of. At the end, we discuss how scripting, and batch files can automate tasks, and save you time.

Terms:
CLI — Command Line Interface (non-GUI)
WCL — Windows Command Line
GUI — Graphical User Interface
Script — Chain of commands to be automatically run in order

Navigating Windows Command Line

Windows-command-line-run.jpg
To open Windows Command Line, click Start > Run and enter the word «cmd». This is a shortcut to opening a historic file called command.com, which is now called cmd.exe (the main program running WCL). The files for WCL can be found in «%systemroot%system32». Whenever you see a value starting and ending with %, you will know this is a variable. The %systemroot% variable will have a value of whatever your main windows folder is. For Windows XP, your system root is C:Windows, unless specified otherwise. For Windows 2000, your system root is C:Winnt.

Terms:
Variable — A value that can change based on user input
Syntax — The way a command is typed (word order)

Navigating the Command Line Interface: Commands and Examples

Each command in Windows Command Line has a different function. Each command also has a help document associated with it (for the most part). To access help for any command, try these two methods:

Windows Command Line Help
(command) /? — This /? at the end of the command will bring up a help document describing different «modifiers» you can add to command using the / symbol.

windows xp cli

If you dont get a help document from the first command, check your syntax, and try the other help command.

HELP — Help document for WCL
Usage: help OR help <command>
Example: help
Example: help copy
Explanation: Help lists commands, help <command> shows command help document

Windows Command Line Commands

Listed below are some commonly used Windows Command Line Commands. They show the command name, its description, usage, and an explanation of what the example command would do.

CD — Change current working directory
Usage: cd <directory you want to open> OR cd
Example: cd
Explanation: Changes your working directory to root (c:)
Example: cd windows
Explanation: Takes you to the windows directory inside your current directory

COPY — copies files or folders to other locations that already exist
Usage: copy <file or folder from> <copy file or folder to>
Example: copy employees.txt c:workemployees

CLS — Clears the screen of all commands
Usage: cls
Example: cls

DEL — Deletes a file from current directory
Usage: del <folder or file name>
Example: del programs
Explanation: Deletes the folder or file named programs

DIR — Used to list all files in current directory
Usage: dir (modifiers can be listed with /?)
Example: dir
Explanation: This will list all files and folders at current location

EXIT — Exits CMD
Usage: exit

FIND — Finds a command given certain search parameters
Usage: Find <search term>
Example: Find «*.txt»
Explanation: Finds all text files in directory
Notes: * can be used as a ‘wildcard’ to mean any length or any combination of letters.

MD — Make directory at current location
Usage: md <directory name you want to make>
Example: md programs
Explanation: This will make a new folder at the current location

MOVE — Moves a file from one location to another (cut)
Usage: Move <full path of file you want to move> <already existing directory to move TO>
Example: Move c:gamesmygame.zip c:newgames
Explanation: This will move the file mygame.zip from one directory, to another existing directory

PAUSE — Pauses scripts or batch files and waits for user input
example: pause
Explanation: When in a script, this displays «Press any key to continue» and waits for user input

RD — Remove Directory
Usage — rd <folder name>
Example: rd windows
Explanation: This removes the directory Windows (bad idea)
Notes: to remove a directory and its contents, «rd /s windows»

REN — Rename a folder or file
Usage: ren <file or folder> <new name you want>
Example: ren windows window
Explanation: this changes your windows directory name to window

TIME — Check or modify system time
Usage: time

VER — Check your version of Windows
Usage: ver

Windows Command Line also interfaces with files on your computer to record data to. Piping and chaining commands is another option in most CLI situations. Chaining commands is simply feeding the output of one command (dir for example outputs a list of files and folders) to another command that you want to run only for the output of the first file.

Piping Commands

The chaining of commands can be used by typing | (shift + ). This is called the pipe, or piping commands. To pipe one command to another, type one full command, and WCL automatically outputs the data that you normally see to the next command.

For example, «dir c:windows | Find «*.txt»
The above example would list all files in c:windows then put all of the files and folders in c:windows get sent to the find command. The find command then looks for any files that end in .txt. You will now see a list of all txt files in c:windows

Output to a text file

Another useful function for script makers is the ability to output text from the command line (input and output) to a text document. Using the output to text file, or append options both come in handy at different times.

> — Create a new text file and have WCL output info to it
Usage: <command to output> > <location of text file to output to>
Example: dir > c:myfiles.txt
Explanation: This command would list all files and folders in current directory, and outputs to file c:myfiles.txt

>> — Append information from a command to a text document.
Usage: <command> >> <file to add to>
Example: dir > c:myfiles.txt
Explanation: This would list files and folders in current directory and ADD the list to myfiles.txt while keeping the previous data in tact.

Chaining Commands

When there are multiple commands you want to run at one time, Chaining commands in Windows Command Line comes in handy. To chain a command, we have two tools.

& — Complete one command then another directly after
Usage: command & command2
Example: dir & ver
Explanation: This will list all files in current directory and then the version of Windows Command Line

&& — Complete one command, then another if the first was successful
Usage: <command1> && <command2>
Example: copy c:importantdata.txt c:backup && ren backupdata.txt
Explanation: This will copy the file importantdata.txt to c:backup, THEN if successful, it will rename the file to backupdata.txt

Processes and Performance

Windows has its GUI version of system performance monitor that shows up every time you press CTRL-ALT-DELETE at the same time. There is also a command line version that can be configured to show much more information for power users.

Another thing to take into account is that when you open a CMD window, it will use a LOT less system resources than a GUI. This can be VERY helpful in ending processes that are lagging your computer a lot.

To access the process and performance monitoring tools, use the following commands:

Tasklist in Windows Command Line (DOS)

TASKLIST — Lists all running processes with detailed information
Usage: Tasklist
Note: the /svc addition to tasklist allows you to see what processes are using what services at the moment
Note2: /M addition shows each process, and associated DLL files

TASKKILL — Stops tasks with given parameters
Usage: Taskkill <which task>
Example: Taskkill /pid 140
Explanation: This will end the task with PID of 140 (the process identification number). You can find the PID for each task using tasklist

Controlling Windows Services in Command Line

Services are extra functions that Windows has the ability to start and stop depending on whether you allow the services to be started. A lot of windows services contribute to slow computing, security risks, and instability in the operating system. While some services are essential, others are never needed. Windows XP Services

To list, modify, start and stop services you will need a new commands to help you.

SC query — Shows list of configured services
Usage: SC query
Explanation: This will list info and data on services

SC qc — Queries a specific service
Usage: SC qc <service name>
Example: sc qc messenger
Explanation: This will show configuration data for the messenger service

SC start — Starts a specific service
Usage: SC start <service name>
Example: SC start messenger
Explanation: This starts the messenger service

SC stop — Stops a specific service
Usage: SC stop <service name>
Example: SC stop messenger
Explanation: This stops the messenger service

SC config — Configures service properties
Usage: SC config <service name> start= <start type>
Example: SC config messenger start = disabled
Explanation: This will tell the messenger service NOT to start with the computer.
Notes: Settings available for start= are Disabled, Auto, and Demand
Disabled never starts, Auto starts every startup, and demand starts as the service is needed

Windows Hard Disk Utils

Windows comes with extensive command line utilities to control, check and maintain your hard disk drives. Included in the utilities are Drive Partitioners, Defragmenters, Check Disk Utilities, and utilities to set a drive to be checked for errors on next startup.

Try some of these Windows Command Line Commands, as they can save your computer in case of disasters like virus’s or improper shutdowns.

CHKDSK — Checks a hard disk for errors
Usage: chkdsk <parameters> <drive to check>
Example: chkdsk /f C:
Explanation: This command will scan drive C for errors, and repair them if needed.
Notes: /f parameter auto-repairs errors when found

DEFRAG — Defragments a hard drive to optimize performance
Usage: Defrag <parameter> <drive letter>
Example: Defrag c:
Explanation: Desfragments the C: drive
Notes: defrag -a <drive letter> will analyze only, and not defragment

User Control

Embedded in Windows XP is the ability to add and remove users. This concept is called a «Multi-User Operating System». This type of system allows for more than one user account to be made, each account with specific permissions to access data or run programs. User Accounts can be changed from control panel, or Windows Command Line.

NET USER — View a list of local user accounts
Usage: Net User <name of user, or blank for all>
Example: Net User Chris
Explanation: Displays user account info for user Chris
Notes: Access to net user can be used across a single domain also
Parameters: net user <name> /delete
Explanation: This deletes a user account

Windows-command-net-user.jpg

NET USER — Adds users to local computer
Usage: net user <username to add> <password to add> /add
Example: net user chris library /add
Explanation: This will add a user to the local computer with the name as chris, and the password as library
Notes: Parameters that go BEFORE /add are
/fullname:»Chris Reed» (Full name of user)
/comment:»Chris is main systems admin» (users comments)
/passwordreq yes (requires password at logon)

Example 2: net user Chris library /fullname:»Chris Reed» /comment: «Chris is main systems admin» /passwordreq yes /add
Explanation: This adds user Chris with password library, and full user name of chris reed, with a user comment as «Chris is main systems admin» and requires a password at logon

Managing TCP/IP and Networking with WCL

TCP/IP is a transmission protocol for two computers communicating through a network. TCP/IP has error checking for the packets that are transferred, and is used in many internet and networking situations.

Windows Command Line allows you to view detailed information about your internet connection, DNS servers, DHCP servers, your internal IP address, and defualt gateway. The commands below will show you how to check your TCP/IP status, modify servers, and set static IP addresses.

Terms:
[code]DHCP — Automatically determined IP set for your computer
Static IP — A custom setup network configuration with unchanging IP
TCP/IP — Communication protocol for 2 computers over a network
Default Gateway — Your router or gateways IP address
Subnet Mask — Defines the section of a network you are on
DNS servers — Computer that resolves URL to IP (www.yoursite.com to IP)
IP address — Your individual computers network ID

Note: To check your TCP/IP connections, network adapter, and settings, you can type ping «127.0.0.1». This will send a ping out through your network adapter, and redirect it right back to your computer. Upon successful ping, you can tell that your computer is setup properly to use TCP/IP.

==
TCP/IP from Windows Command Line ==

IPCONFIG — Shows IP information for your computer
Usage: IPCONFIG or IPCONFIG /all
Example: ipconfig /all
Explanation: Shows all information about current TCP/IP connection
Notes: Other parameters /flushDNS (resets DNS cache) /release (releases your network adapter) /renew (renews your network adapter)

Windows-command-ipconfig.jpg

SET ADDRESS — sets tcp/ip settings via WCL
Usage: Set address name=»<connection name>» source=<static or dhcp> addr=<static IP> mask=<subnet mask> gateway=<gateway IP>

Static IP Network Configuration
Example: Set address name=»Local Area Connection» source=static addr=192.168.1.201 mask=255.255.255.0 gateway=192.168.1.1
Explanation: This will make the computer setup a new connection called Local Area Connection, with a STATIC IP of 192.168.1.201, a subnet mask of 255.255.255.0 and a gateway of 192.168.1.1

DHCP Network Configuration
Example: set address name=»Local Area Connection» source=»dhcp»
Explanation: This will setup a new connection name Local Area Connection that will try to automatically set your IP using DHCP protocol. (Your router or gateway will be the DHCP server usually)

DELETE ADDRESS — Removes a connection from your list
Usage: Delete Address name=<address name> addr=<IP address>

DNS Server Setup
DNS servers are computers connected to the internet with records of URLs (www.yoursite.com) and the matching IP address for the URLs server (68.48.0.12). Your computer connects to a DNS server every time you enter a web page in your address bar. Although you dont usually see the IP address information, it is hiding beneath your browser or internet program.

To setup custom DNS servers using WCL, you will need the following commands. For your DNS server, you can either contact your ISP, and use one of theirs, or you can try using your router.

ADD DNS — Sets custom DNS servers to use
Usage: ADD DNS name=<DNS server name> addr=<ip of DNS server>
Example: ADD dns name=»My Pinacolataburg DNS» addr=»68.48.0.12″
Explanation: Adds a DNS server named My Pinacolataburg DNS with an IP address of 68.48.0.12

DELETE DNS — removes a specific DNS entry from a connection
Usage: delete dns name=<name to delete> addr=<IP to delete>
Example: delete dns name=»My Pinacolataburg dns» addr=68.48.0.12
Explanation: This will remove the DNS server entry above

Windows Command Line has an array of tools for diagnosing network problems. You can view individual stats for network adapters and network connections. You can also view the path to a certain internet host, get ping information for the host, and find all open TCP/IP connections with information on what program is using the connection.

Tracert — Find ping, and number of hops to reach a given server
Usage: Tracert <internet host to trace the route to>
Example: tracert www.computershack.net
Explanation: This command would give tracert information from the originating computer, to the opposite end of the connection.

PING — Find how long it takes for a message to be send to a server, and back again.
Usage: Ping < internet host IP or URL >
Example: ping www.computershack.net
Explanation: Ping shows the time, in milliseconds it takes to contact the given IP or URL, plus the time it takes to get back to your computer.

NETSTAT — Shows information about network connections
Usage: Netstat <parameters>
Example: Netstat -b
Explanation: With the parameter -b, netstat shows a list of all open connections, the port, and program that is managing the connection.
Notes: Another parameter is -a to view all open connections/ports

Windows-command-netstat.jpg

NETSH — Network Shell is a collection of tools to diagnose network components.
Usage: NETSH <parameter>
Example: NETSH diag ping adapter
Explanation: This will ping each item in your TCP/IP configuration. Included is DNS, DHCP, WINS, and Default Gateway

Conclusion: Using the information in this document, it is possible to control, maintain, diagnose, and fix problems in almost all categories. With this information, try using Windows Command Line more often. It will help you become a better technician, and be able to fix more problems faster.

More Resources:

  • Official Microsoft Command Line Reference

The Windows command line is a powerful tool that can be used for a variety of tasks. From basic tasks like managing files and directories to more advanced tasks like scripting and automation, the command line can help you do just about anything. This article will guide you on opening the Windows command prompt and provide you with the Windows command line cheat sheet.

Windows command prompt

What is Windows command line?

The windows command line is a text-based interface that allows you to execute commands on your computer. Often referred to as the «command prompt» or simply «prompt,» the command line provides a text-based interface for issuing commands and controlling your computer. You can perform all sorts of tasks using the command line, from launching programs to accessing system settings. While the command line may seem daunting at first, it’s actually quite easy to use. With a bit of practice, you can quickly learn how to use the windows command prompt to manage your computer more efficiently.

How do I open a command line in Windows?

Opening the command line in Windows is a simple process. First, open the Start menu by clicking the Start button or pressing the Windows key. Then, type «cmd» into the search box and press Enter. This will open the Windows Command Prompt. From here, you can type any commands you wish to execute.

Open Windows 11 command prompt

Alternatively, you can also press the «Windows key + R» on your keyboard. This will open the «Run» dialog box. Type «cmd» into the box and press Enter.

Run cmd via Windows plus R key

Now that you know how to open command prompt in Windows, you can use it to run various commands to perform tasks on your computer.

Windows Command Line Cheat Sheet

If you’re new to the Windows command line, you may be feeling a bit overwhelmed. There are so many different commands and options, and it can be difficult to know where to start. But don’t worry- we’ve got you covered. Our windows command line cheat sheet pdf provides a handy reference guide to all the most commonly used commands. Simply print it out or keep it open on your desktop, and you’ll always have the information you need right at your fingertips. Or you can view the online sheet below, and start making the most of the command line!

Command What does it do?

Files & Folders Comands

assoc Fix file associations.
attrib Change file attributes.
cd (or chdir) Change current working directory.
comp Perform a comparison of multiple files.
compact Copy files from one location to another.
del (or erase) Delete files.
dir List files and subfolders.
expand Expand compressed files.
fc File compare.
find Filter a string in files.
findstr Search for patterns of text in files.
md (or mkdir) Create  a directory or subdirectory.
move Move files from one directory to another.
openfiles Display the current open files list or disconnect opened files/folders.
print Send a text file to a printer.
rd (or rmdir) Delete a directory.
ren (or rename) Rename a file or directory.
replace Replace existing or add new files to a directory.
robocopy Copy file data from one location to another.
tree Display tree structure of a directory.
type Display the contents of a text file.
xcopy Copy files and directories.

Disk & Partition Commands

active Mark the partition with focus as active.
chkdsk Check disk.
chkntfs Display or modify automatic disk checking when the computer is started.
clean Remove all partitions or volume formatting from the disk with focus.
convert Convert a disk from one disk type to another.
create Create partition or volume.
defrag Locates and consolidates fragmented files on local volumes.
delete Delete a partition or a volume.
detail Display information about the selected disk.
diskcomp Compare the contents of two floppy disks.
diskcopy Copy content of the disk.
diskpart Manage computer disks and drives.
diskperf Start or stop disk performance counters for Performance Monitor.
extend Extend a partition or a volume.
format Format a disk to accept Windows files.
freedisk Check to see if the specified amount of disk space is available before continuing with an installation process.
fsutil Perform tasks that related to FAT and NTFS file systems.
gpt Assign gpt attribute(s) to a partition.
label Create, change, or delete the volume label of a disk.
list Display a list of disks.
recover Recover readable information from a bad or defective disk.
vol Display the disk volume label and serial number.

Network Commands

arp Display and modify entries in the ARP cache.
bitsadmin Create, download or upload jobs and monitor their progress.
dnscmd Manage DNS servers.
ftp Connect to and use FTP.
getmac Return the MAC address.
ipconfig IP configuration.
ipxroute Display and modify information about the routing tables used by the IPX protocol.
irftp Sends files over an infrared link.
jetpack Compact a WINS or DHCP database.
netsh Network Shell utility.
netstat Display network statistics.
net use Connect/disconnect a computer to/from a shared resource
ping View the computer name and the IP address of an endpoint computer.
tracert Determine the route to a destination by sending ICMP packets to the destination.

System Information & Configuration Commands

date Display or set the system date.
driverquery Display device driver status and properties.
hostname Display the computer hostname.
powercfg Power configuration.
shutdown Turn off computer.
systeminfo Display computer system information.
time Display or set the system time.
ver Display Windows system version number.

Command Line Setup Commands

cls Clear the command prompt window.
cmd Start a new instance of the command interpreter.
color Change the foreground and background colors in the Command Prompt window for the current session.
exit Quit and close the command prompt.
help Display a list of the available commands.
prompt Change the Cmd.exe command prompt.
title Set the Cmd.exe window title.

Conclusion

Windows command line can be extremely useful for any Windows user. If you want to learn more about using the commands, the windows command line cheat sheet would be a great resource. Whether you’re a beginner or an experienced user, the sheet can help you get the most out of your windows experience.

Updated: 12/31/2020 by

Windows command line (DOS)

This page covers the basics of navigating and using the Microsoft Windows command line. On this page, you learn how to move around in the command line, find files, manipulate files, and other important commands. Realize that there are over 100 different commands used in MS-DOS and the Windows command line. If you are interested in learning about the command line in more detail, see our DOS and command prompt overview, which gives a description and example for every command.

Get into the Windows command line

Open a Windows command line window by following the steps below. If you need additional information or alternative methods for all versions of Windows, see: How to get to an MS-DOS prompt or Windows command line.

  1. Click Start.
  2. In the Search or Run line, type cmd (short for command), and press Enter.

Understanding the prompt

After following the steps above, the Windows command line should be shown (similar to the example below). Windows often starts you at your user directory. In the example below, the user is Mrhope. So, C:UsersMrhope> is our prompt. This prompt shows that we’re in the C: drive (default hard drive letter) and currently in the Mrhope directory, a subdirectory of the Users directory.

Windows command line

Key tips

  • MS-DOS and the Windows command line are not case-sensitive.
  • The files and directories shown in Windows are also found in the command line.
  • When working with a file or directory with a space, surround it in quotes. For example, the directory My Documents would be «My Documents» when typed.
  • File names can have a long file name of 255 characters and a three character file extension.
  • When a file or directory is deleted in the command line, it is not moved into the Recycle Bin.
  • If you need help with any of command, type /? after the command. For example, dir /? would give the options available for the dir command.

Listing the files

Let’s learn your first command. Type dir at the prompt to list files in the current directory. You should get an output similar to the example image below. Without using any dir options, this is how dir output appears. As shown, you are given information including the creation date and time, directories (<DIR>), and the name of the directory or file. In the example below, there are 0 files listed and 14 directories, indicated by the status message at the bottom of the output.

Listing files in the Windows command line

Every command in the command line has options, which are additional switches and commands that can be added after the command. For example, with the dir command, you can type dir /p to list the files and directories in the current directory one page at a time. This switch is useful to see all the files and directories in a directory with dozens or hundreds of files. Each of the command options and switches is listed in our DOS command overview. We offer guides for individual commands, as well. For example, if you want to see all the options for the dir command, refer to our dir command overview for a complete option listing.

The dir command can also be used to search for specific files and directories using wildcards. For example, to list files or directories that begin with the letter «A» you could type dir a* to list only the AppData directory, in this above example. See the wildcard definition for other examples and help with using wildcards.

  • How to list files in a directory or folder on the computer.

Moving into a directory

Now that we’ve seen a list of directories (shown below) in the current directory, move into one of those directories. To move into a directory, we use the cd command, so to move into the Desktop type cd desktop and press Enter. Once you’ve moved into a new directory, the prompt changes. So, in our example, the prompt is now C:UsersMrhopeDesktop>. You can see what files are found in this directory by typing the dir command again.

Windows command line listing Desktop files

  • How to change a directory or open a folder.

Understand the files

In the Desktop directory, as shown in the above example, there are 23 files and 7 directories, representing different file types. In Windows, you are familiar with files having icons that help represent the file type. In the command line, the same thing is accomplished by the file extensions. For example, «forum posts.txt» is a text file because it has a .txt file extension. Time.mp3 is an MP3 music file and minecraft.exe is an executable file.

  • Listing of file extensions and additional help with file extensions.

Most users are only concerned with executable files, which as mentioned above, are files ending with .exe, .com, and .bat. When the file name is typed in the command line, the program runs, which is the same as double-clicking a file in Windows. For example, if we wanted to run minecraft.exe, typing minecraft at the prompt runs that program.

Note

Realize that if the executable file you are trying to run is not in the current directory, you get an error. Unless you have set a path for the directory with the executable file, which is how the command line finds external commands.

If you want to view the contents of a file, most versions of the command line use the edit command. For example, if we wanted to look at the log file hijackthis.log, we would type edit hijackthis.log at the prompt. For 64-bit versions of Windows that do not support this command, you can use the start command (e.g., type start notepad hijackthis.log) to open the file in Notepad. Additional information about opening and editing a file from the command line is available on the page linked below.

  • How to open, view, and edit the contents of a file on a computer.

Moving back a directory

You learned earlier the cd command can move into a directory. This command also lets you go back a directory by typing cd.. at the prompt. When this command is typed, you’ll be moved out of the Desktop directory and back into the user directory. To move back to the root directory type cd to get to the C:> prompt. If you know the name of the directory you want to move into, you can also type cd and the directory name. For example, to move into C:Windows>, type cdwindows at the prompt.

  • How to change a directory or open a folder.

Creating a directory

Now with your basic understanding of navigating the command line, let’s start creating new directories. To create a directory in the current directory, use the mkdir command. For example, create a directory called «test» by typing mkdir test at the prompt. If created successfully, you are returned to the prompt with no error message. After the directory is created, move into that directory with the cd command.

  • How to create a directory or folder.

Switching drives

In some circumstances, you may want to copy or list files on another drive. To switch drives in the Windows command line, type the drive letter of the drive followed by a colon. For example, if your CD-ROM drive is the D drive, you would type d: and press Enter. If the drive exists, the prompt changes to that drive letter. If the drive does not exist or is not accessible (e.g., no disc in CD-ROM drive), you get an error.

  • How to copy files from one drive to another drive.
  • How to change drives in MS-DOS and Windows command line.

Creating a new file

You can create a new file from the command line using the edit command, copy con command, or using the start command to open a file.

  • How to create a file in MS-DOS and the Windows command line.

Creating a new batch file

In the new test directory, let’s create your first file. In most circumstances, you never need to create any file at the command line, but it is still good to understand how files are created. In this example, we are creating a batch file. A batch file is a file that ends with .bat and helps automate frequently used commands in the command line. We are calling this batch file example, so type edit example.bat at the prompt. As mentioned in the document on creating a file, if the edit command does not work, use the start command to open the batch file in Notepad. To perform this action, you type start notepad example.bat into the prompt.

Both of the commands above open a new blank example.bat window. In the file, type the three lines below, which clear the screen with the cls command and run the dir command.

@echo off
cls
dir

After these three lines are typed into the file, save, and exit the file. If you are in the edit command, click File (or press Alt+F) and then Save. After the file is saved and you are back at the command prompt, typing dir displays the «example.bat» file in the test directory.

Now, run the batch file to get a better understanding of what a batch file does. To run the batch file, type example at the prompt, which executes the batch file, clears the screen, and runs the dir command.

  • Full information and additional examples on batch files.

Moving and copying a file

Now that we’ve created a file, let’s move it into an alternate directory. To help make things easier, create another directory for the files. So, type mkdir dir2 to create a new directory in the test directory called dir2. After the new directory is created, use the move command to move the example.bat file into that directory. To do this, type move example.bat dir2 at the prompt. If done successfully, you get a message indicating the file was moved. You could also substitute the move command for the copy command to copy the file instead of moving it.

  • How to move files and folders on the computer.
  • How to copy files.

Rename a file

After the file is moved into the dir2 directory, move into that directory with the cd command to rename the file. In the dir2 directory, use the rename command to rename the example file into an alternate name. Type rename example.bat first.bat at the prompt to rename the file to «first.bat.» Now, when using the dir command, you see «first.bat» as the only file.

Tip

When renaming any file, make sure the file has the same file extension. If you were to rename the .bat file to a .txt file, it is no longer an executable file only a text file. Also, realize that renaming the file to a different file extension does not convert the file. For example, if you renamed the file as an .MP3, it may look like an MP3 in Windows, but it’s not going to play music.

  • How to change or rename a file, folder, or directory.

Deleting a file

Now that we’ve had our fun with our new file, delete the file with the del command. Type del first.bat to delete the first.bat file. If successful, you are returned to the prompt with no errors, and the dir command shows no files in the current directory.

Tip

When deleting files, you can also use wildcards to delete multiple files at once. For example, if the directory contained several .GIF image files you could type del *.gif to delete all files ending with the .gif file extension.

  • How to delete a file, directory, or folder.

Renaming a directory

Go back one directory to get back to the test directory using the cd.. command mentioned earlier. Now, rename our dir2 directory to something else using the same rename command we used earlier. At the prompt, type rename dir2 hope to rename the directory to «hope.» After this command is completed, type dir and you see one directory called «hope.»

  • How to change or rename a file, folder, or directory.

Removing a directory

While still in the test directory, remove the hope directory using the rmdir command. At the prompt, type rmdir hope to remove the hope directory.

Tip

If the directory you are trying to remove contains any files or directories, you’ll receive an error. To prevent this error, use the /s option. For example, if the hope directory still had the first.bat file, you would need to type rmdir /s hope at the prompt.

  • How to delete a file, directory, or folder.

Running a program

Any executable file can run from the command line by typing the name of the file. For example, if you listed files using the dir command and see a file named «myfile.exe,» typing «myfile» at the command line runs that program.

  • How to run a file from MS-DOS.

How to list available commands

After getting a good understanding of using the command line from the steps shown above, you can move on to other available commands by typing help at the command line. Typing «help» displays a list of available commands with a brief description of each command.

Closing or exiting the command line window

After you are done with the Windows command line, you can type exit to close the window.

In conclusion

Now you have a good understanding of how to navigate the command line, create directories and files, rename directories and files, and delete. As mentioned earlier, there are hundreds of other commands you can use at the command line. If you want to expand your knowledge further, we recommend looking at the options available for each command above and reviewing our commands overview page. You can also use our search to find any command by the name of the command or by the action it performs.

Command Prompt (or CMD) is Microsoft’s command-line interpreter for its Windows operating systems. It enables you to use commands for performing various operations on your computer — everything from creating new files and moving files between folders to more advanced actions like task automation.

windows command prompt

Not just that, you can also use the Command Prompt to carry out administrative operations or fix certain kinds of system issues on Windows. In short, pretty much any action you can think of doing with Windows’ GUI can probably be done more efficiently with its CLI (Command Line Interface) counterpart, thanks to the Command Prompt.

However, to perform any of these actions, you need to be familiar with the Command Prompt commands. In this guide, we’ve put together a list of all such essential commands that you need to know to use the Command Prompt effectively on your Windows PC.

Before you dive into the commands, first, launch the Command Prompt. You can do this in a few different ways. However, the easiest way to go about this is to hit Windows + R key to open Run, enter “cmd”, and press Enter.

Also, while you’re at it, you should pin Command Prompt to the taskbar so you can easily access it next time. For this, with CMD running, right-click on its icon in the taskbar and select More > Pin to taskbar.

With that done, all you have to do now to run a command is to type in the command and hit the Enter key.

1. Find

Find is one of the most useful Windows CMD commands. It lets you search for a string in a file or multiple files and returns the lines that contain the text you specified in your query.

So if you’d like to search for a string in a specific file, you’ll need to run:

find /i "query_string" pathtofile

…where /i is a switch to avoid case-sensitive searching.

Eg:

find /i "command prompt commands" C:UsersDellDocumentsCommands.txt

To search for text in multiple documents:

find /i "query_string" pathtofile1 pathtofile2

In case you still can’t file your document, you can narrow down your search to a specific set of files:

find /i "query_string" *.file_type

Eg:

find /i "command prompt commands" *.txt

2. Copy con

If you haven’t used the command prompt much before, you’re probably using Windows’ GUI to create new files. Although this is perfectly acceptable, there is another (read efficient) way to accomplish this: it involves running the copy con command in the CMD window to speed up the entire process.

To use it, follow the below syntax:

copy con file_name_with_extension

Eg:

copy con MyFile.txt

…and start populating the file with text. Once done, hit Ctrl + Z to save the file.

Alternatively, if you want to create a single-line text file, you can also use the echo command:

echo your_text_here > file_name_with_extension

3. Rename

The rename command enables you to rename files and folders on your computer right from the command line. Run your command in the following syntax to rename a file:

rename current_file_name new_file_name

Eg:

rename File1.txt MyFile.txt

If you want to rename the files in other folders, prepend their path before the filename.

Eg:

rename C:UsersDellDocumentsFile1.txt File2.txt

4. Copy

As its name suggests, the copy command allows copying file(s) from one location on your system to another. It comes with a few different switches to help you extend its scope of use and put it to use for your different requirements. And, you can even use it to combine multiple files.

To copy a file from an existing directory, use the following syntax:

copy file_name destination_file

Eg:

copy MyFile.txt D:Files

When you want to copy a file from a different folder:

copy source_file destination_file

For copying multiple files of the same type in a folder to another location:

copy *.txt D:Documents

Similarly, if there’s a need to combine two files into a new file, enter:

copy file_name_1 + file_name_2 file_name_3

5. Move

Using the copy command, you can create a copy of a file on some other location on your computer. Occasionally, however, when you want to relocate a file or directory to a different location and don’t want an extra copy, you need the move command.

With move, you can move your files/folders by running:

move file_name destination_address

or

move folder_name destination_address

Eg:

move MyFile D:Documents

or

move MyFolder D:

Do note that you need administrative access on your system to move files/folders around, so make sure you’re running CMD as an administrator before carrying out such operations. You can do this by searching “cmd” in Run and pressing the Ctrl+Shift+Enter keys or by right-clicking on its app icon and selecting Run as administrator.

6. Del

Short for delete, the del command helps you delete files from your computer. You can use it in conjunction with switches to get around deletion restrictions on the system.

To delete a file from your current directory, run:

del file_name

For deleting a file inside a folder:

del pathtofile

Eg:

del D:Documentsmyfile

When you want to delete all files in a folder:

del pathtofolder

Eg:

del D:Documents

7. Mkdir

Similar to the copy con and echo command, which let you create files, Windows also has a similar utility to create folders: it’s called mkdir. Using it, you can create a folder or a subfolder within a folder right from the CMD window.

To create a folder in the current working folder, use the following syntax:

mkdir folder_name

When you want to create a folder in other :

mkdir pathtofolder

Eg:

mkdir D:Documents

8. Rmdir

The Rmdir command assists you with deleting a folder or its subfolders on your computer. It also provides a couple of switches to help you in the deleting process.

For removing a folder in the current folder, simply run:

rmdir folder_name

To do it for a folder in another drive:

rmdir pathtofolder

Eg:

rmdir D:Documents

When there are multiple subfolders and you want to delete all of them at once:

rmdir /s pathtofolder

Eg:

rmdir /s D:Documents

Since the above command prompts for confirmation, you can bypass it by adding the /q switch:

rmdir /s /q folder_name

9. Cls

Cls is the most elementary yet significant Command Prompt command. It lets you clear your CMD window that might get crowded with outputs from all the previous commands you’ve run to have a clean slate to work on it again.

To clear your Command Prompt window with it, run:

cls

10. Dir

When working on the Command Prompt, navigating between different folders is one of the basic tasks you’ll need to do.

To this end, Windows has the dir command, which outputs a list of all the folders and their subfolders on your system, so you get an idea about a folder’s content. Not just that, it also returns the total number of files and subfolders along with the free space available on the disk.

You can view the files and subfolders inside a folder by running:

dir

To view a list of all the files of a particular kind:

dir *.extension

Eg:

dir *.txt

When you want to view all folders:

dir /a

Just a list of hidden folders:

dir /a:d

A list of all the hidden files:

dir /a:h

11. Cd

Viewing a list of files and folders on your system is one half of the navigation process; the other requires you to change the folder (or directory). The cd command helps you with just that and features a few different switches to make navigating around a little more convenient.

In addition to changing directories, cd also displays the name of your current working directory, so you can run it to know where you are in your file system.

For this, simply run:

cd

Now, if you wish to go to the root directory of the system, you’d enter:

cd

To change the directory:

cd D:

For accessing a particular folder:

cd C:pathtofolder

Eg:

cd C:Extras

When you want to go to the parent folder of your current folder:

cd ..

12. Sfc

Sfc, short for System File Checker, is a built-in utility on Windows operating systems that enables you to scan and restore the corrupted system files on your PC.

If your system keeps crashing, shows DLL file errors, or displays the BSoD (Blue Screen of Death), it’s likely suffering from file corruption. And, this is where you can use the sfc command to fix such issues.

For scanning your system to identify system file errors, run:

sfc /scannow

[Since it’s an administrative task, you need to be running CMD as an administrator.]

Once the scanning finishes, you’ll get a message showing your system status and whether there’s a need for any fix.

You can also use sfc to scan a specific file by running:

sfc /scanfile=pathtofile

If you just want to scan the integrity without performing repairs:

sfc /verifynow

Similarly, when you only need to verify the integrity of a particular file:

sfc /verifyfile=pathtofile

13. Chkdsk

Similar to sfc, Microsoft also offers another utility called chkdsk (Check Disk), which examines the disk space of your logical or physical drivers to identify its integrity and attempt a fix if there are any errors. It supports various switches that help with scanning and identifying potential parameters for disk failure.

To run a simple chkdsk scan on a drive, make sure you’re running CMD with elevated privileges and use the syntax below:

chkdsk drive_name /f

Eg:

chkdsk D: /f

If you suspect the drive to have bad sectors:

chkdsk drive_name /r

…where /r implies /f but also includes checks for bad sectors.

14. Systeminfo

Systeminfo (or System Information) gives you detailed system configuration information about a PC. You can use it to find out details such as the system model, operating system build, BIOS version, RAM, and installed NIC, among others.

For this, all you have to do is run the following command:

systeminfo

To get system information about a remote computer:

systeminfo /s hostname_or_IP_address

15. Where

The command’s name is pretty much a giveaway here: it allows you to find the installation directory/path for an app on your PC. So you can find out the installation paths for different programs on your computer and use them whenever required. For instance, when there’s a need to change their default launch programs.

Use the following syntax to find out the path for a program:

where program_name

Eg:

where notepad

16. Assoc

Assoc is a powerful CMD command that enables you to change the default associations for the various file extensions on your system. Using it, you can change the default app for opening the different kinds of file types.

For instance, if you want to open all the .txt files in Notepad, you can do so right from the Command Prompt.

To do this, first, identify the existing association for that file extension by running:

assoc .file_extension

Eg:

assoc .txt

Next, make sure you are running CMD as an administrator and find the path for the app that you want to assign. You can do this using the where command.

Copy the returned path and use it with the following syntax:

assoc .file_extension=pathtoapp

Eg:

assoc .txt=C:WindowsSystem32notepad.exe

17. Driverquery

Windows PCs often run into driver issues, be it when you get a new hardware accessory or when an existing one starts malfunctioning out of the blue. In such situations, getting to know the installed drivers on your system can help you identify the problem and find its fix.

The driverquery command helps you with just that: it presents you with a list of all installed drivers on your system.

To use it, simply run:

driverquery

18. Fc

Fc or File Compare gives you the ability to you compare two files and view the differences between them side by side, right from the Command Prompt. So, if you’re in a situation where you’ve got multiple files with similar text in them, you can run them through fc to identify the differences, if any.

Use the syntax below to compare two files:

fc /a file_name_1 file_name_2

…where /a signifies ASCII comparison.

When you want to compare other kinds of files, like .exe, .sys, .obj, .bin, etc., you’d need to add the /b switch:

fc /b file_name_1 file_name_2

19. Ping

Ping is a built-in network management tool on Windows that helps you determine your PC’s connectivity with other devices (computers/servers). So, if you’re facing issues connecting to the internet or another device, you can check your connectivity status by running the ping command in the following syntax:

ping hostname

Eg:

ping google.com

or

ping IP_address

Eg:

ping 142.250.192.46

When you want to ping an IP address and resolve to its hostname:

ping /a IP_address

20. Tracert

Tracert is a slightly more nuanced network troubleshooting utility than ping: it helps you identify the path between the source and the destination point, so you know the path (involving hops) traversed by the network packets.

To trace the path to a hostname, run:

tracert IP_address

or

tracert domain_name

If you want to speed up the process, you can use the /d switch, with the following syntax, to prevent tracert from resolving the IP addresses of hops:

tracert /d IP_address_or_domain_name

21. Netstat

Netstat (or Network Statistics) takes network troubleshooting up a level over both ping and tracert. It presents you a list of many network connection statistics, such as open ports, active connections (incoming and outgoing), and even the routing table to give you a comprehensive overview of your entire network.

It also provides various switches, which you can include in your commands, to get more network statistics.

At its most basic level, you can run netstat to get a list of all the connections to/from your PC.

But to filter out, say, just the active connections and ports, you’d need to run:

netstat -a

For viewing ethernet statistics:

netstat -e

When you want to get the process ID (PID) for each connection:

netstat -o

To view the routing table:

netstat -r

22. Ipconfig

Ipconfig (or IP Configuration) is an important network configuration command that shows you different information about a network, such as its IP address, subnet mask, default gateway, MAC address, DNS server, and DHCP status, to name a few.

Additionally, it also allows you to perform certain network-related operations on your computer, which come in handy during troubleshooting and make the process a lot more convenient.

To get just the basic information about your network, simply run:

ipconfig

For a more detailed look into the network:

ipconfig /all

When you want to release an IP address used by an adapter:

ipconfig /release

To request a new IP address:

ipconfig /renew

For clearing the DNS resolver cache:

ipconfig /flushdns

23. Tasklist

When you experience slowdowns on your computer, one of the likely explanations is the excessive consumption of resources by the processes running in the background. The tasklist command helps you in determining such processes right from the command window by listing down all the currently running processes on your system.

For obtaining a list of all the processes on your system, run the following command:

tasklist

To display verbose task information:

tasklist /v

24. Taskkill

Just as its name suggests, the taskkill command allows you to end running tasks (or processes) on your system. It’s kind of an extension of the tasklist command — responsible for listing all the currently running processes — that helps you end the processes running heavy on your system resources.

So when there’s a need to kill a process, you simply need to run:

taskkill /pid process_ID

Eg:

taskkill /pid 7018

To end a process along with its child processes:

taskkill /pid process_ID /t

For forcefully killing a process:

taskkill /pid process_ID /f

25. Attrib

Attrib is an essential administrative utility that allows you to set or remove attributes assigned to the different files and folders on your computer to deny or grant access to them to other users on your PC. If you’ve got multiple users sharing the same PC, this can prove to be of great use in helping you manage what these users can access on the system.

Before you add or remove attributes for a file/folder, first identify its attributes by running:

attrib file_name

Then, to add a new attribute, use the following syntax:

attrib +r file_name_or_folder_name

Eg:

attrib +r MyFile

…where +r sets the read-only attribute to the file/folder.

Below are some other attributes you can use:

  • +h – to set the hidden file attribute
  • +s – to set the system file attribute
  • +a – to set the archive file attribute
  • +v – to set the integrity file attribute
  • +x – to set the scrub file attribute to limit background data usage

Use the attribute with the minus sign () to remove the attribute. You can also club multiple attributes together in a command to add or remove them from a file/folder.

Efficiently Performing Windows Operations With Command Prompt

Using the CMD commands above, you can perform most of the system operations on your Windows PC quickly and efficiently while saving yourself the extra steps you’d otherwise have to take if you followed the GUI approach.

Of course, these are just some of the Command Prompt commands, and there’s a bunch of other complex commands, like installing programs using Winget, that you can use to carry out advanced operations. We feel the commands on this list will set the groundwork to get you familiar with the Command Prompt and its working to help you become proficient with it.

Was this article helpful?

YesNo

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *