Top 50 Useful CMD commands for daily use in Windows OS

Top 50 Useful CMD commands for daily use in Windows OS 7/8/10/

Top 50 Useful CMD commands:

CMD (Command Prompt) commands are a collection of instructions or commands that allow you to do numerous activities and operations in the Windows operating system using a text-based interface. The Command Prompt is a very useful tool that enables users to communicate with the operating system, run applications, modify files and directories, adjust system settings, administer networks, and conduct administrative duties.
Sure, here are 50 Useful CMD commands (Command Prompt) , along with descriptions and sample scripts.

1. cd (Change Directory):

  • Explanation: cd stands for “Change Directory.” It’s a command used to switch the current working directory to another directory.
  • Script: cd Desktop

2. dir (Directory):

  • Explanation: The dir command is used to display a list of files and folders within the current directory. This command is useful for navigating and exploring the contents of a directory.
  • Script: dir

3. mkdir (Make Directory):

  • Explanation: The mkdir command, short for “Make Directory,” is used to create a new directory or folder.
  • Script: mkdir NewFolder

4. rmdir (Remove Directory):

  • Explanation: The rmdir command, which stands for “Remove Directory,” is used to delete a directory or folder.
  • Script: rmdir OldFolder

5. copy:

  • Explanation: The copy command is used to duplicate one or more files and move them to a specified location.
  • Script: copy file.txt C:\Backup

6. del (Delete):

  • Explanation: The del command, short for “Delete,” is used to remove one or more files from the file system.
  • Script: del file.txt

7. ren (Rename):

  • Explanation: The ren command, which stands for “Rename,” is used to change the name of a file or directory.
  • Script: ren oldfile.txt newfile.txt

8. move:

  • Explanation: The move command is used to relocate files from one directory to another.
  • Script: move file.txt C:\NewLocation

9. echo:

  • Explanation: The echo command is used to display messages or toggle the echoing feature on or off.
  • Script: echo Hello, World!

10. type:

  • Explanation: The type command is used to display the contents of a text file.
  • Script: type file.txt

11. cls (Clear Screen):

  • Explanation: The cls command, which stands for “Clear Screen,” is used to clear the command prompt window.
  • Script: cls

12. attrib (Attributes):

  • Explanation: The attrib command, short for “Attributes,” is used to display or modify file attributes.
  • Script: attrib +h file.txt

13. ipconfig (IP Configuration):

  • Explanation: The ipconfig command, which stands for “IP Configuration,” is used to display network configuration information on a Windows system.
  • Script: ipconfig

14. ping:

  • Explanation: The ping command is used to test the reachability of a host on an IP network.
  • Script: ping google.com

15. tracert (Trace Route):

  • Explanation: The tracert command, which stands for “Trace Route,” is used to display the path taken by packets across an IP network to reach a specified host.
  • Script: tracert google.com

16. netstat (Network Statistics):

  • Explanation:
    The netstat command, short for “Network Statistics,” is used to display information about active network connections, routing tables, and other network-related statistics.
  • Script: netstat -a

17. tasklist:

  • Explanation: The tasklist command is used to display a list of currently running processes on a Windows system.
  • Script: tasklist

18. taskkill:

  • Explanation: The taskkill command is used to terminate one or more processes on a Windows system.
  • Script: taskkill /IM processname.exe

19. shutdown:

  • Explanation: The shutdown command is used to shut down or restart a computer.
  • Script: shutdown /s /t 0

20. systeminfo:

  • Explanation: The systeminfo command is used to display detailed configuration information about a computer running a Windows operating system. When you enter systeminfo into the command prompt, it provides a comprehensive list of details such as the operating system version, installed hotfixes, system model, processor information, and more. This command is helpful for obtaining an overview of the system’s hardware and software configuration.
  • Script: systeminfo

21. echo.:

  • Explanation: The echo. command is used to insert a blank line in the command prompt. This command is commonly used for formatting output or improving readability in command-line scripts or interactions.
  • Script: echo.

22. pause:

  • Explanation: The pause command is used to temporarily suspend the execution of a batch file and display a message to the user.
  • Script: pause

23. exit:

  • Explanation: The exit command is used to close or exit the command prompt or a batch file.
  • Script: exit

24. start:

  • Explanation: The start command is used to open a new window and execute a specified program or command in a Windows environment. In the provided script:
  • notepad is the program or command to be executed.
  • Script: start notepad

25. assoc (File Association):

  • Explanation: The assoc command, which stands for “File Association,” is used to display or modify file extension associations in a Windows operating system.
  • Script: assoc .txt

26. ftype (File Type):

  • Explanation: The ftype command, which stands for “File Type,” is used to display or modify the file type used for a specific file extension in a Windows operating system.
  • Script: ftype txtfile

27. find:

  • Explanation: The find command is used to search for a specific text string within files.
  • Script: find “keyword” file.txt

28. xcopy (Extended Copy):

  • Explanation: The xcopy command, short for “Extended Copy,” is used to copy files and directory trees in a Windows environment.
  • Script: xcopy source destination

29. md5sum:

  • Explanation:
    The md5sum command is used to calculate and display the MD5 checksum of a file in Linux and Unix-like operating systems. However, the provided script appears to be a command for Windows systems using certutil to calculate the MD5 checksum of a file.
  • Script: certutil -hashfile filename MD5

30. attrib (Attribute Change):

  • Explanation: The attrib command is used to change the attributes of a file or directory in Windows. In the provided script:
  • -r removes the read-only attribute from the file.
  • +s sets the system attribute for the file.
  • Script: attrib -r +s file.txt

31. robocopy (Robust File Copy):

  • Explanation: The robocopy command, which stands for “Robust File Copy,” is an advanced utility in Windows used to copy files and directories with greater control and flexibility. In the provided script:
  • sourcedir represents the source directory from which files and directories will be copied.
  • destdir represents the destination directory where the files and directories will be copied to.
  • /MIR is a switch that mirrors the source directory to the destination directory, meaning it will copy all files and directories from the source to the destination and also delete any files in the destination that no longer exist in the source.
  • Script: robocopy sourcedir destdir /MIR

32. schtasks (Scheduled Tasks):

  • Explanation: The schtasks command, which stands for “Scheduled Tasks,” is used to enable the scheduling of tasks, such as running programs or scripts, on a Windows system. In the provided script:
  • /create is the parameter used to create a new scheduled task.
  • /tn “TaskName” specifies the name of the task being created.
  • /tr “C:\Script.bat” specifies the path to the program or script to be executed by the task.
  • /sc daily specifies the frequency at which the task should run, in this case, daily.
  • Script: schtasks /create /tn “TaskName” /tr “C:\Script.bat” /sc daily

33. net user:

  • Explanation: The net user command is used to manage user accounts on the system in Windows. In the provided script:
  • username represents the name of the user account being added.
  • /add is the parameter used to add a new user account.
  • Script: net user username /add

34. net share:

  • Explanation: The net share command is used to manage shared resources on a Windows system. In the provided script:
  • SharedFolder is the name assigned to the shared resource.
  • C:\Folder is the path to the folder being shared.
  • Script: net share SharedFolder=C:\Folder

35. net use:

  • Explanation: net use is a command used to connect or disconnect a computer from a shared resource.
  • Script: net use Z: \\computername\SharedFolder

36. net view:

  • Explanation: The net view command is used to display a list of resources available on the network in a Windows environment. This command is helpful for discovering network resources and navigating shared environments.
  • Script: net view

37. shutdown:

  • Explanation: The shutdown command is used to shut down or restart a computer in a Windows environment. In the provided script:
  • /s parameter instructs the computer to shut down.
  • /t 0 parameter sets the delay before shutdown to 0 seconds, meaning the shutdown will occur immediately.
  • Script: shutdown /s /t 0

38. shutdown (Remote):

  • Explanation: The shutdown command, when used with the “/m” parameter, allows you to shut down or restart a remote computer in a Windows environment. In the provided script:
  • /m \\computername specifies the remote computer by its name.
  • /s parameter instructs the remote computer to shut down.
  • /t 0 parameter sets the delay before shutdown to 0 seconds, meaning the shutdown will occur immediately.
  • Script: shutdown /m \\computername /s /t 0

39. powercfg:

  • Explanation: The powercfg command is used to control power settings and configurations in a Windows environment. In the provided script:
  • /hibernate on parameter enables hibernation mode on the system.
  • Script: powercfg /hibernate on

40. taskmgr:

  • Explanation: The taskmgr command is used to open the Task Manager in a Windows environment.
  • Script: taskmgr

41. chkdsk (Check Disk):

  • Explanation: chkdsk (Check Disk) is a command used to check a disk for errors and display a status report.
  • Script: chkdsk C:

42. sfc (System File Checker):

  • Explanation: The sfc command, which stands for “System File Checker,” is used to scan and verify the integrity of system files in a Windows environment. In the provided script:
  • /scannow parameter initiates a scan of all protected system files and repairs any corrupted files it finds.
  • Script: sfc /scannow

43. netsh (Network Shell):

  • Explanation: The netsh command, short for “Network Shell,” is used to display or modify network configuration settings in a Windows environment. In the provided script:
  • interface ipv4 show config is a subcommand that displays the IPv4 configuration details for network interfaces.
  • Script: netsh interface ipv4 show config

44. regedit (Registry Editor):

  • Explanation: The regedit command is used to open the Windows Registry Editor.
  • Script: regedit

45. cipher:

  • Explanation: The cipher command is used to display or alter the encryption of directories in a Windows environment. In the provided script:
  • /e parameter is used to encrypt the specified directory.
  • /d parameter is used to decrypt the specified directory.
  • directory is the path to the directory you want to encrypt or decrypt.
  • Script: cipher /e /d directory

46. telnet:

  • Explanation: Connects to a remote computer using Telnet protocol.
  • Script: telnet hostname

47. whoami:

  • Explanation: Displays the username and domain of the current user.
  • Script: whoami

48. gpupdate:

  • Explanation: Refreshes Group Policy settings.
  • Script: gpupdate /force

49. netdom (Network Domain):

  • Explanation: Manages domains and trust relationships.
  • Script: netdom join ComputerName /domain:DomainName /userD:UserName /passwordD:*

50. attrib (Attribute Manipulation):

  • Explanation: Changes file attributes.
  • Script: attrib +h +s file.txt

These commands provide a wide variety of functions, including basic file management, network administration, and system setup.
Understanding and using CMD commands may greatly improve a user’s ability to effectively manage and control their Windows-based system, automate processes, diagnose problems, and execute numerous administrative responsibilities.

 

Also Read: Top Most 50 CMD Commands for Security of Windows 7/8/10/11 Systems.

Also Read: Payment Gateway – What is it, How does it work, Why You Should Use and Examples

Scroll to Top