cover-img

Maximizing Efficiency with the Most Useful Windows 10 Commands

5 December, 2022

5

5

0

Introduction

Windows 10 offers a wide range of commands that can be used to perform a variety of tasks. In this blog post, we will explore some of these commands and provide examples of how they can be used and I used them personally to increase my efficiency.

1. date command

The date command in Windows 10 allows you to view or set the current date on your computer. This can be useful if you need to check the date for a specific purpose, or if you need to change the date for some reason.
To use the date command, open a command prompt window and type date followed by the new date in the format dd-mm-yyyy. For example, to set the date to December 6, 2022, you would use the following syntax:
date 06-12-2022
If you don't specify a date, the date command will simply display the current date. For example:
date
You can also use the /t option to display the date in a specific format. For example:
date /t
This will display the current date in the format dd/mm/yyyy. There are many other options available for the date command, and you can use them to customize the output and display the date in the format that is most useful for you.

2. comp command

The comp command in Windows 10 allows you to compare the contents of two files and see if they are identical. This can be useful if you want to ensure that two files are exactly the same, or if you want to see what the differences are between them.
To use the comp command, open a command prompt window and type comp followed by the names of the two files you want to compare. For example, to compare the files file1.txt and file2.txt, you would use the following syntax:
comp file1.txt file2.txt
This will compare the contents of the two files and display any differences. If the files are identical, the comp command will not display any output. If the files are different, the comp command will display the line number and the specific differences between the two files.
You can also use the /l option to compare the files in a case-insensitive manner, so that differences in the use of upper and lowercase letters are not considered. For example:
comp /l file1.txt file2.txt
This will compare the contents of the two files in a case-insensitive manner, and display any differences. There are many other options available for the comp command, and you can use them to customize the output and compare the files in the way that is most useful for you.

3. copy command

The copy command in Windows 10 allows you to copy files from one location to another. This can be useful if you want to duplicate a file, move a file to a different location, or combine multiple files into a single location.
To use the copy command, open a command prompt window and type copy followed by the name of the source file and the destination. For example, to copy the file file1.txt to a new location called C:\myfolder, you would use the following syntax:
copy file1.txt C:\myfolder
This will copy the file file1.txt to the C:\myfolder directory. If the destination already contains a file with the same name, the copy command will overwrite it.
You can also use the /y option to suppress the confirmation prompt that appears when you are copying a file with the same name as an existing file. For example:
copy /y file1.txt C:\myfolder
This will copy the file file1.txt to the C:\myfolder directory without prompting for confirmation. There are many other options available for the copy command, and you can use them to customize the output and copy the files in the way that is most useful for you.

4. echo command

The echo command in Windows 10 allows you to display text on the screen. This can be useful for a variety of purposes, such as displaying a message to the user, testing the output of a script, or creating a batch file.
To use the echo command, open a command prompt window and type echo followed by the text you want to display. For example, to display the message "Hello World!", you would use the following syntax:
echo Hello World!
This will display the message "Hello World!" on the screen. You can also use the /n option to suppress the line break that is typically added after each echo command. For example:
echo /n Hello World!
This will display the message "Hello World!" on the same line as the echo command. There are many other options available for the echo command, and you can use them to customize the output and display the text in the way that is most useful for you.

5. find command

The find command in Windows 10 allows you to search for text within files on your computer. This can be useful if you want to find a specific word or phrase in a file, or if you want to search for a pattern of text.
To use the find command, open a command prompt window and type find followed by the text you want to search for and the name of the file you want to search in. For example, to search for the word "hello" in the file file1.txt, you would use the following syntax:
C:\> find "hello" file1.txt
This will search the file file1.txt for the word "hello", and will display any lines that contain the word. You can also use the /c option to display the number of times the search term appears in the file, or the /n option to display the line numbers of the lines that contain the search term. For example:
C:\> find /c /n "hello" file1.txt
This will search the file file1.txt for the word "hello", and will display the number of times the word appears in the file, as well as the line numbers of the lines that contain the word. There are many other options available for the find command, and you can use them to customize the output and search for text in the way that is most useful for you.

6. findstr command

The findstr command in Windows 10 allows you to search for text within files. This can be useful if you want to find a specific word or phrase within one or more files, or if you want to search for files that contain specific text.
To use the findstr command, open a command prompt window and type findstr followed by the text you want to search for and the names of the files you want to search in. For example, to search for the word "hello" in the file file1.txt, you would use the following syntax:
findstr hello file1.txt
This will search the file file1.txt for the word "hello" and display any lines that contain that word. You can also use the /m option to display the name of the file in which each match was found. For example:
findstr /m hello file1.txt
This will search the file file1.txt for the word "hello" and display the name of the file, as well as the line number and the matching text, for each match that is found.
findstr /s /i /c:"book" *.txt
This will search for the word "book" within all text files in the current folder. There are many other options available for the findstr command, and you can use them to customize the output and search for text in the way that is most useful for you.
Now you may be wondering why the findstr command looks similar to the find command, and why we need another command when we already have find. But here's the catch: findstr also adds support for regular expressions, making it more similar to the grep command in Linux.

7. remove command

The remove command in Windows 10 allows you to delete files or folders from your computer. This can be useful if you want to free up space on your hard drive, or if you want to get rid of unnecessary or unwanted files.
To use the remove command, open a command prompt window and type remove followed by the name of the file or folder you want to delete. For example, to delete the file file1.txt, you would use the following syntax:
remove file1.txt
This will delete the file file1.txt from your computer. If the file is in use, the remove command will display an error message and will not be able to delete the file.
You can also use the /f option to force the deletion of a file, even if it is in use. For example:
remove /f file1.txt
This will delete the file file1.txt from your computer, even if it is in use. There are many other options available for the remove command, and you can use them to customize the output and delete files in the way that is most useful for you.

8. rename command

The rename command in Windows 10 allows you to change the name of a file or folder on your computer. This can be useful if you want to give a file or folder a more descriptive or meaningful name, or if you want to change the file extension to match the file type.
To use the rename command, open a command prompt window and type rename followed by the current name of the file or folder and the new name. For example, to rename the file file1.txt to file2.txt, you would use the following syntax:
rename file1.txt file2.txt
This will change the name of the file file1.txt to file2.txt. If the new name already exists, the rename command will display an error message and will not be able to rename the file.
You can also use the /a option to change the attributes of a file, in addition to its name. For example:
rename /a file1.txt file2.txt
This will change the name of the file file1.txt to file2.txt, and will also change the attributes of the file, such as the read-only or hidden status. There are many other options available for the rename command, and you can use them to customize the output and rename files in the way that is most useful for you.

9. where command

The where command in Windows 10 allows you to search for files or folders on your computer. This can be useful if you are looking for a specific file or folder, but you are not sure where it is located.
To use the where command, open a command prompt window and type where followed by the name or partial name of the file or folder you are looking for. For example, to search for all files or folders that contain the word "hello", you would use the following syntax:
where *hello*
This will search your computer for all files or folders that contain the word "hello" in their name, and will display the full path of each match that is found. You can also use the /r option to search subdirectories, as well as the current directory. For example:
where /r *hello*
This will search your computer for all files or folders that contain the word "hello" in their name, and will search all subdirectories, as well as the current directory. There are many other options available for the where command, and you can use them to customize the output and search for files in the way that is most useful for you.

10. whoami command

The whoami command in Windows 10 allows you to view your current user account. This can be useful if you want to confirm which user account you are currently logged in with, or if you want to find out more information about your user account.
If you have come across the whoami Linux command, which allows Linux users to see the currently logged-in user, it may look similar but it works a little bit differently on Windows. Let's take a closer look at how it works.
To use the whoami command, open a command prompt window and type whoami. This will display the name of your current user account, as well as the domain name and the security identifier (SID) of the account. For example:
C:\> whoami myusername\mydomain S-1-5-21-1234567890-1234567890-1234567890-1234
This will display the name of your user account as myusername\mydomain, and will also display the SID of the account. You can also use the /upn option to display the user principal name (UPN) of your user account. For example:
C:\> whoami /upn myusername@mydomain.com
This will display the UPN of your user account as myusername@mydomain.com. There are many other options available for the whoami command, and you can use them to customize the output and view more information about your user account.

11. path command

The path command in Windows 10 allows you to view or modify the list of directories that are searched for command line executables. This can be useful if you want to add a new directory to the search path, or if you want to remove a directory from the search path.
To use the path command, open a command prompt window and type path. This will display the current search path, which is a list of directories that are searched for executables when you enter a command at the command prompt. For example:
C:\> path PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
This will display the current search path, which includes the directories C:\Windows\system32C:\WindowsC:\Windows\System32\Wbem, and C:\Windows\System32\WindowsPowerShell\v1.0\.
To modify the search path, you can use the /p option to add a new directory to the search path, or the /d option to remove a directory from the search path. For example, to add the directory C:\myfolder to the search path, you would use the following syntax:
C:\> path /p C:\myfolder
This will add the directory C:\myfolder to the search path, and will allow you to run executables from that directory by simply typing their name at the command prompt. There are many other options available for the path command, and you can use them to customize the search path in the way that is most useful for you.

12. set command

The set command modifies the current shell's (the window's) environment values, and the change is available immediately, but it is temporary. The change will not affect other shells that are running, and as soon as you close the shell, the new value is lost until such time as you run set again
To use the set command, open a command prompt window and type set. This will display a list of all the environment variables on your computer, along with their current values. For example:
C:\> set ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\myusername\AppData\Roaming CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=MYCOMPUTER ...
This will display a list of all the environment variables on your computer, along with their current values. To modify an environment variable, you can use the set command followed by the name of the variable and the new value. For example, to change the value of the TEMP environment variable, you would use the following syntax:
C:\> set TEMP=C:\myfolder
This will change the value of the TEMP environment variable to C:\myfolder, which will be used by programs that require a temporary directory. There are many other options available for the set command, and you can use them to customize the environment variables in the way that is most useful for you.

13. setx command

The setx command in Windows 10 allows you to create or modify environment variables for your user account or for the system. Environment variables are values that contain information about the environment in which a program runs, such as the directories that are searched for executables, the default editor, or the default printer. The setx command is similar to UNIX utility SETENV
Here is a catch setx command modifies the value permanently, which affects all future shells, but does not modify the environment of the shells already running. You have to exit the shell and reopen it before the change will be available, but the value will remain modified until you change it again.
To use the setx command, open a command prompt window and type setx followed by the name of the environment variable you want to create or modify and the new value. For example, to create a new environment variable called MYVAR with the value hello, you would use the following syntax:
C:\> setx MYVAR hello
This will create a new environment variable called MYVAR with the value hello. To modify an existing environment variable, you can use the same syntax. For example, to change the value of the TEMP environment variable, you would use the following syntax:
C:\> setx TEMP C:\myfolder
This will change the value of the TEMP environment variable to C:\myfolder, which will be used by programs that require a temporary directory.
By default, the setx command creates or modifies environment variables for the user account that is currently logged in. To create or modify environment variables for the system, you can use the /m option. For example:
C:\> setx /m MYVAR hello
This will create a new environment variable called MYVAR with the value hello, and will make it available to all user accounts on the computer. There are many other options available for the setx command, and you can use them to customize the environment variables in the way that is most useful for you.

14. sort command

The sort command in Windows 10 allows you to sort the lines of a text file alphabetically or numerically. This can be useful if you want to organize the lines in a text file, or if you want to compare the contents of two text files.
To use the sort command, open a command prompt window and type sort followed by the name of the text file you want to sort. For example, to sort the lines in the file file1.txt, you would use the following syntax:
C:\> sort file1.txt
This will sort the lines in the file file1.txt alphabetically, and will display the sorted lines on the screen. You can also use the /r option to sort the lines in reverse order, or the /o option to save the sorted lines to a new file. For example:
C:\> sort /r /o file2.txt file1.txt
This will sort the lines in the file file1.txt in reverse order, and will save the sorted lines to a new file called file2.txt. There are many other options available for the sort command, and you can use them to customize the output and sort the lines in the way that is most useful for you.

15. title command

The title command in Windows 10 allows you to change the title of the command prompt window. This can be useful if you want to identify the window by a more descriptive or meaningful title, or if you want to customize the appearance of the window.
To use the title command, open a command prompt window and type title followed by the new title you want to use. For example, to change the title of the window to "My Command Prompt", you would use the following syntax:
C:\> title My Command Prompt
This will change the title of the command prompt window to "My Command Prompt". You can also use the /u option to make the title appear in uppercase letters, or the /l option to make the title appear in lowercase letters. For example:
C:\> title /u MY COMMAND PROMPT
This will change the title of the command prompt window to "MY COMMAND PROMPT", with all letters in uppercase. There are many other options available for the title command, and you can use them to customize the appearance of the command prompt window in the way that is most useful for you.

16. tree command

To use the tree command, open a command prompt window and type tree followed by the path of the folder or drive you want to display and this is one of my favorite command which I use mostly. For example, to display the directory structure of the C:\ drive, you would use the following syntax:
tree C:\
This will display the tree structure of the C:\ drive, including all of its subfolders and files. You can also use the /f option to display the full path of each file, and the /a option to display hidden files and folders. For example:
tree C:\ /f /a
This will display the full directory structure of the C:\ drive, including hidden files and folders, with the full path of each file displayed. There are many other options available for the tree command, and you can use them to customize the output and display the information that is most useful for you.

I appreciate you taking the time to read this blog post. If you found it useful, please consider sharing it with others who may benefit from the information. Thanks again for reading! 👋

develevate

toolstipstricks

5

5

0

develevate

toolstipstricks

Kartik S Prajapati
Security Researcher 🔒• Full Stack Web Developer 🚀 • Vue.js & Laravel • DM for collaborations 🤝

More Articles

Showwcase is a professional tech network with over 0 users from over 150 countries. We assist tech professionals in showcasing their unique skills through dedicated profiles and connect them with top global companies for career opportunities.

© Copyright 2025. Showcase Creators Inc. All rights reserved.