CMD Commands
CMD Commands
To sum up…
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.
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.
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].
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.
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.
@echo off
color 0a
:top
echo %random% %random% %random% %random% %random%
%random% %random% %random% %random% %random% %random% %random% %random% %random%
goto top
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.