logo
Windows 107 Useful Commands Windows 10 Users Should Know

7 Useful Commands Windows 10 Users Should Know

By Achilles Hill | Last Updated

We've mentioned the basic setup of Common Prompt and its functions to add, delete and format disk partitions. Common Prompt is powerful and a lot of other things can be achieved when using it. So in this post, we are going to tell you about 7 useful command prompt tricks windows 10 users should know.

1: Change drive in Command Prompt

If you want to run a command on a particular disk, use "driver-letter + :" to change disk drive. For example, if you want to change the drive from C: to G:, type "g:" and press Enter. Then you will see that the drive has changed.

change disk drive

2: Clear command line windows

After executing multiple commands, the screen of the command prompt usually looks cluttered. In this case, cls command is come in handy.

Type "cls" and then press the "Enter" key. Then all of your previous commands on the screen are cleared.

Be careful not to conflict with the command-line tool. If you want to clear the screen after using the command-line tool (like DiskPart), you need to exit it first and then type cls to clear the screen.

clear command line windows

3: Launch PowerShell from CMD

Step 1: Open cmd. Type powershell and hit Enter. The command prompt will turn to PowerShell.

Step 2: If you want to run powershell as administrator from cmd. Based on the step 1, type the command "start-process powershell-verb runas".

lanuch powershell form cmd

4: Empty recycle bin command line

Step 1: In the taskbar, type CMD in the search box. Right-click the Command Prompt and choose "Run as administrator".

Step 2: Type the below command and hit Enter to empty Recycle Bin for a specific drive:

rd /q /s drive-letter:\$Recycle.Bin

Remember to replace drive-letter with the disk letter you'd like. If you want to clean up multiple disks, change the drive-letter and repeat the above steps.

empty recycle bin

5: Add user accounts from CMD

Step 1: Type CMD in the search box on the desktop. Right-click the Command Prompt and choose "Run as administrator".

Step 2: Type "net user username password /add" and hit Enter. In this command, "username" is the name you give your account and "password" is the password you want to log in the account.

For instance, if you want to create a user named "isunshare" with the password "isunshare123". You can type "net user isunshare isunshare123 /add" and press Enter.

Step 3: (optional). When you want to give administrator rights to your new net user, type "net localgroup Administrators username /add" and hit Enter. Replace "username" with a new username.

add user accounts from cmd

6: Check for corrupt system files through CMD

If your computer has problems, you can run System File Checker to find corrupted or missing system files.

Step 1: Type cmd in the search box and right-click the top result to choose "Run as administrator".

Step 2: Type sfc /scannow command in Command Prompt, and hit Enter. Wait for the repair process to complete.

If your system files aren't broken, you'll see "Windows Resource Protection did not find any integrity violations" message after finishing repair process.

7: Show hidden files with Command Prompt

Step 1: Type cmd in the search box, right-click the top result and select "Run as administrator".

Step 2: (optional). View hidden files. Type "dir drive-letter: /a:h /b /s" and press Enter to view hidden files of a specific drive. Remember to replace drive-letter according to your situation. For example, type "dir C: /a:h /b /s" and hit Enter.

Then you'll see all the hidden files of C drive. Please note that you can view hidden files with dir command, but you couldn't see them in corresponding drive.

Step 3: Show hidden files with attrib command. Type "attrib -h -r -s /s /d drive-letter:\*.*" and hit Enter to show hidden files in a specific drive. If you replace drive-letter to C, type "attrib -h -r -s /s /d c:\*.*" and press Enter.

show hidden files with attrib command

Exit the command prompt and you can see all hidden files in C drive.

Related Articles: