Useful CMD commands All Windows users should know

Some Useful CMD Commands

 So you can have more control over your computer

The Windows command prompt is a feature that has been an essential part of Windows for a long time. Some CMD commands are very useful and easy to use, so ordinary users see the Windows command prompt as a key part of the operating system.

There are always rumors that they will be phased out sometime, but this is unlikely to happen any time soon.
Here are some of the best CMD commands that you should know if you want more control over your Windows computer.

ASSOC:repair file associations
ASSOC Command


One of the most powerful tools in the CMD command library is the ASSOC command.

Your computer associates file extensions with specific programs. This is how your computer knows to open Adobe when you double-click a PDF file, or Microsoft Word when you double-click a DOC file.

You can view all the file associations your computer knows by typing ASSOC in the Command window. You will see the file extension and the associated software.
You can set the association by typing something like assoc .doc = Word.Document.8.

FC: file compare

FC COMMAND


Sometimes when files change over time, it is difficult to remember the differences between versions. You may not know that the CMD command provides the ability to compare files and see all the differences, but it’s true.
The FC command executes either ASCII or binary file comparison, listing all the differences it finds.
Fc / a File1.txt and File2.txt will compare two ascii files.
Fc / b Picture1.jpg Picture2.jpg will do a binary comparison on two pictures.

 IPCONFIG: Configure IP


Network troubleshooting is never simple, but the only thing that makes it easier is IPCONFIG. Using this command at a CMD command prompt returns detailed information about the current network adapter connection, including:
Current IP address
Subnet mask
Default IP gateway
Current domain
This information can help you troubleshoot router and other connectivity issues that you may experience with your network adapter.

NETSTAT: Network statistics

NETSTAT COMMAND

Worried about the possibility of running malware on your computer that connects to websites without your knowledge?

If you run a NETSTAT command at a command prompt, you can get a list of all active TCP connections from your computer.

PING: send test packs

PING COMMAND


IT’s best friend is PING. Running this command sends test packets over the network to the target system. You can use the PING command to test whether your computer can access another computer, server, or even a Web site. Can help detect network outages. It also provides packet transit time in milliseconds, so it also detects an invalid network connection.


 TRACERT: Route tracking

TRACERT COMMAND

TRACERT is a great way to use the Windows Command. If you’re interested in seeing the path that Internet traffic takes to get from your browser to a remote system such as Google’s servers, you can use TRACERT to see it.

The command is a “trace path,” which sends packets to a remote destination (server or website), and gives you all the following information:

The number of hops (proxy servers) before reaching the destination
The time it takes to reach each jump
IP and sometimes the name of each jump
TRACERT can reveal how to change the ways your Internet requests depend on where you access the web. It also helps in troubleshooting the router or running it on a local network may be a problem.

POWERCFG: Power Configuration

POWERCFG COMMAND


Are you frustrated at the speed with which your laptop seems to run out? Your power settings may be configured as efficiently as possible. There is a CMD windows command called POWERCFG (Power Configuration) that can help. Start a command prompt as an administrator and type powercfg -power to get the full energy efficiency report.

This process may take about one minute, but when this is done, you will see if there are any warnings or errors that may help you improve the energy efficiency of your system.
View the energy-report.html file for details of those errors and warnings.

 Shutdown: Turn off the computer

Shutdown Command


The SHUTDOWN command is a versatile command that lets you shut down your computer, but you can control the behavior of this shutdown. It is commonly used as a scheduled task or as part of an IT batch job after you apply the fixes to the computer system.

Typing shutdown / i from the command prompt will start the shutdown, but the GUI should give the user a choice as to whether to restart or a full shutdown. If you don’t want any GUI-based interface to appear, you can only issue a shutdown command.
There is a long list of other parameters that you can use to log off, hibernate, reboot, and more. Just type shutdown without any arguments to see them all.

SYSTEMINFO: System Information

SYSTEMINFO COMMAND


If you want to know what type of network card you have, processor details, or the exact version of Windows, the SYSTEMINFO command can help.

This will investigate your system and pull out the most important information about your system. Lists the information in a clean, easy-to-read format.
SFC: System File Checker

SFC Command



If you are ever worried that a virus or other program may have corrupted your core system files, there is a Windows command that can scan these files and ensure their integrity.

You need to run CMD as administrator (right-click and choose Run as administrator). Typing SFC / SCANNOW will check the integrity of all protected system files. If a problem is found, the files will be fixed using the system backup files.

The SFC command also allows you to:

/ True: Check integrity but do not repair files.
/ SCANFILE: Scan the integrity of specific files and repair if corrupted.
/ VERIFYFILE: Check the integrity of specific files but do not fix them.
/ OFFBOOTDIR: Use this to make repairs to an offline boot directory.
/ OFFWINDIR: Use this to make repairs to the Windows offline directory.
/ OFFLOGFILE: Specifies a path to save a log file with scan results.
The test can take up to 10 or 15 minutes, so give it time.

NET USE: Map drives





If you want to map a new drive, you can always open File Explorer, right-click on this computer, and go to the Map Network Drive Wizard. However, by using the NET USE command, you can do the same with a single command string.

For example, if you have a share folder on a computer on your network called \ OTHER-COMPUTER SHARE , you can set this as your Z drive by typing the command:
Net use Z: “\ other computer SHARE” / firmware: yes

The permanent adapter tells your computer that you want to reset this drive each time you log on to your computer.

 CHKDSK: Check disk

CHKDSK Command



While the SFC command only verifies the integrity of core system files, you can use the CHKDSK command to scan a full drive.

Command Check Drive C: and fix any problems, run the command window as administrator and type CHKDSK / f C :.
This checks things like:

Hash file
Disk errors
Corrupted sectors
The command can fix any errors on the disk (if possible). When you are finished, you will see the status of the examination and the actions taken.

S
CHTASKS:Task Scheduler
Windows comes with a wizard to create scheduled tasks. For example, you may have a BAT file stored on the C: temp that you want to run daily at noon.

You must click the Scheduled Tasks Wizard to configure this. Or, you can type one SCHTASKS command to set it up.

SCHTASKS / create / SC HOURLY / MO 12 / TR Example / TN c: temp File1.bat

The scheduled key accepts arguments such as minute, hour, day, and month. Then you can specify the frequency with the / MO command.
If you type the command correctly, you will see the reply, Success: The scheduled task “Example” was successfully created.

ATTRIB: Change file attributes
In Windows, you can change file attributes by right-clicking a file and finding the appropriate property to change. However, instead of looking for the file attribute, you can use the ATTRIB command to set the file attributes.


For example, if you type: ATTRIB + R + H C: temp File1.bat, File1.bat will be set as a read-only hidden file.
There is no response when it is successful, so if you do not see an error message, the command succeeds.

Other Windows CMD commands
As you can see, there are some powerful and useful things you can do with the Windows command prompt, if you know the right commands.

Believe it or not, there are more commands that will give you the ability to do some things you may never have realized by simply typing a simple command.


BITSADMIN: Start uploading or downloading tasks over the network or the Internet and monitor the current status of file transfers.
Color: Change the background color of the command prompt window.
COMP: Compare the contents of any two files to see the differences.
FIND / FINDSTR: Look for strings within any ASCII files.
PROMPT: Change the command prompt from C: > to something else.
Address: Change the title of the command prompt window.
REGEDIT: Edit the keys in the Windows registry (use with caution).
ROBOCOPY: Powerful file copy tool built in Windows.
If you’re interested in learning more, Microsoft offers a complete list of all Windows CMD commands that are included in the latest version of Windows.

1 thought on “Useful CMD commands All Windows users should know”

Leave a comment