0% found this document useful (1 vote)
5K views

CMD Commands

Uploaded by

JOEL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
5K views

CMD Commands

Uploaded by

JOEL
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

40 Windows CMD Commands that

Will Make You Feel Like a Real


Hacker
Basic & Advanced Windows Command Prompt Commands.
LAST UPDATED ON JANUARY 27, 2023
INTERMEDIATE READ
Mission accomplished! Time to apply what you learned.
VLADIMIR
UNTERFINGHER
CYBERSECURITY PADAWAN

Windows‟ celebrated CLI (i.e., Command-Line Interpreter) is, without a doubt, a


treasure trove of hidden features, tools, and settings. Although a bit off-putting given its
lackluster GUI, Command Prompt lets you tap into every area of your Operating
System, from creating new folders to formatting internal/external storage. To help you
navigate cmd.exe like a pro, we‟ve prepared this small, but a compressive list
of Windows cmd commands. Enjoy and don‟t forget to subscribe to our newsletter!

Getting Started with Command Prompt


Unsure about using cmd.exe? Not a problem; just follow this step-by-step guide to get
started. First of all, you‟ll need to fire up Command Prompt. Now, the easiest way to do
that is by hitting Windows Key + R and typing in cmd in the Run window. Hit Enter and
CMD will momentarily pop up on your screen. Of course, there‟s more than one way to
summon Command Prompt. For the second method, you‟ll want to hit the Windows
key to bring up the Start Menu. After that, simply type in cmd or command prompt in the
search bar and left-click on the icon.

To sum up…

Method 1: Windows key + R -> type cmd -> press Enter

Method 2: Windows key -> type cmd or command prompt -> left-click on the CMD icon.

Now that Command Prompt is up and running, it‟s time to have some fun. We‟re going
to start with a couple of basic commands and then move on to the more advanced stuff.
Basic Windows CMD Commands
1. Ver – displays operating system version on the screen (e.g., Microsoft Windows [Version
10.0.19045.2486])
2. Date – displays the current date on the screen. Can also be used to change the date.
3. Shutdown – shuts down your machine.
4. Taskkill – allows you to terminate a process or a running app. To use this, type
in taskkill followed by „/f‟, „/im‟, and the name of the process or app you want to
terminate (e.g. winword.exe). So, if we want to kill all instances of MS Word, we would
need to type in taskkill /f /im winword.exe. Hit Enter to confirm.
5. Color – changes the color of the foreground and background. For instance, typing in „color
fc‟ will make the background bright white and the foreground (i.e., writing) light red.
6. Getmac – displays your machine‟s MAC address.
7. Ipconfig – displays your IP address.
8. Ping – sends data packets to a specific IP address or network (e.g., ping google.com).
Very useful in troubleshooting Internet connectivity issues.
9. Pathping – maps the connection to a specific IP address. Can also be used to
troubleshoot connectivity issues.
10. Nslookup – displays the DNS record or IP address of a specific domain (e.g., nslookup
facebook.com).
11. Chkdks – performs a routine check on a specified disk and corrects errors.
12. Gpupdate – updates group policies. Usually used in conjunction with the force (/f)
argument.
13. Mkdir – creates a new directory.
14. Tasklist – displays a list of all live processes and applications.
15. Timeout – very useful when working with batch files. This command allows you to delay
execution for a specified number of seconds. When appended the -1 value, process
execution will be delayed indefinitely. The computer will wait for a keystroke to continue.
16. Type – this command allows you to view text files (.txt) in your cmd window.
17. Vol – displays disk volume information such as serial numbers or labels.
18. Systeminfo – displays useful sys info such as Host Name, OS version, processor, BIOS
version, time zone, applied hotfixes, and more.
19. Netstat – displays info about active TCP connections.
20. Help – outputs a list of commonly used commands.
Advanced Windows CMD Commands
And now it‟s time to lose the kid gloves and talk about some more advanced (and cool)
CMD commands.

1. Telnet – allows you to establish a remote, Telnet-type connection. Before attempting to


„dial‟, ensure that both machines support Telnet communication and that the client
software is installed. To initiate this type of remote session, you must specify the IP
address of the server or the main computer followed by 13531 (e.g. telnet 60.227.102.16
13531). The number at the far end of the command represents the communication port
used by the Sage 50 Connection Manager. If the setup‟s done right, your CMD cursor
should become blank. Otherwise, it will return the message “telnet is not recognized as an
internal or external command, operable program, or batch file”. This error message
appears when Telnet‟s not enabled on the machine. To switch it on, click on
the Start button and head to Control Panel. Under Programs and Features, select Turn
Windows Features on or off. Scroll down until you see Telnet Client and Telnet
Server. Enable both features and click the Ok button to confirm. Restart your machine.
Open a new CMD window and retry the connection.
2. Klist – this command allows you to visualize cached Kerberos tickets and retrieve useful
information such as encryption type, server, start time, renew time, session key type,
cached flags, and more.
3. FC – changes made to files may not always be obvious. To see if a file has been modified,
use the File Compare (FC) command in CMD. You can perform two kinds of file
comparisons: ASCII or binary. For instance, you may want to use an ASCII-type
comparison when working with a text file. On the other hand, for media (e.g. pictures,
clips, etc.) a binary comparison would be the proper approach.
4. Powercfg – this is a great diagnostic tool for laptop users. Ever wondered why your
battery‟s running out so fast, leaving you high and dry, possibly in the middle of an
(important) e-meeting? Well, you can quickly find out by running this Power Configuration
utility in CMD. Powercfg usually works best with the „-energy‟ argument. So, after running
the combo „powercfg -energy‟, your machine will begin a 60-second power test. It will
generate a power efficiency diagnostic report. If any errors are found, they will be
highlighted in the second section of the report, along with recommendations.
5. Cacls – this nifty command allows you to display or modify ACLs (i.e. Access Control
Lists) of various files. Some of its more popular uses include granting specific access
rights to users (i.e. Read, Write, Change, or Full Control), revoking permissions, denying
specific users, or replacing the user‟s access rights. Here‟s a quick example of how to use
the Cacls command.

Step 1. Create a text document on your desktop area. Name it ‘test.txt’

Step 2. Open CMD.

Step 3. Navigate to the Desktop directory by typing in ‘cd desktop’

Step 4. Type in ‘cacls test.txt’. This will display users and permissions.

Step 5. In this example, we will update (replace) the default rights of user
BUILTIN\Administrators from F (i.e. Full Control) to R (i.e. Read only) using the /P
argument.

Step 6. Type in ‘cacls test.txt /P BUILTIN\Administrators: R

Step 7. Type ‘Y’ and press Enter to confirm changes.

6. ARP – display or commit changes to the ARP cache. To view the contents of the
cache, type in ARP -a and press ENTER. If you want to make changes to the ARP
cache such as adding a static entry use ARP-a, followed by the Internet address (i.e. IP)
and the physical address (i.e. MAC). For instance, if we have a new host and want to
associate its IP to its physical address, we will need to type in the following line: ARP-a
[IP_address] [Physical_Adress].

7. Chgport – use this command to display or remap COM ports.

8. Cipher – check the encryption status of your files or folders (i.e., NTFS partitions
only).

9. Cmdkey – displays and allows you to make modifications to all host-stored passwords
and usernames.

10 Dispdiag – allows you to diagnose display-related issues. Can create log dump files
when used together with the [-d] argument.

11. Driverquery – displays a list of all the drivers installed on the machine.

12. Fondue – install optional MS Windows updates from CMD.


13. Hwrcomp – this command allows you to install or update existing handwriting
recognition dictionaries.

14. Makecab – used to compress files and folders.

15. Mrinfo – displays router interface info.

16. Pentnt – this command allows to user to detect so-called floating-point division
errors in Pentium processors.

17. Reagentc – use this command to configure the Windows Recovery Environment.

18. Recover – retrieve data from a bad disk.

19. Repair-bde – useful in decrypting/repairing a damaged drive that‟s been encrypted


with BitLocker.

20. Runas – execute an application with another user‟s credentials.

BONUS – Raining Code


To be true to the saying “all work and no play (…), here‟s how you can make your CMD
„rain‟ code. It doesn‟t do anything useful, but it sure looks cool. Enjoy!

Step 1. Create a fresh .txt file on your desktop.

Step 2. Open it and paste the following code:

@echo off
color 0a
:top
echo %random% %random% %random% %random% %random%
%random% %random% %random% %random% %random% %random% %random% %random% %random%
goto top

Step 3: Save as .bat.

Step 4: Run the .bat file as admin and watch it pour code.

Note: if nothing‟s happening, go back and edit the file. Use Notepad or Notepad++ to
open it. Ensure that all instances of %random are on the same line.
Wrap-up
This concludes the article on the best Windows Command Prompt commands. Hope
you‟ve enjoyed it. For any questions or additions, be sure to hit the comments section.
Be seeing you! Don‟t forget to stay safe, take it easy, and subscribe to Heimdal®‟s
newsletter for more goodies.

If you liked this article, follow us on LinkedIn, Twitter, Facebook, YouTube,


and Instagram for more cybersecurity news and topics.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy