Posted: . At: 12:28 PM. This was 6 years ago. Post ID: 11574
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Obscure Windows CMD commands.


There are quite a few Windows CMD commands that users do not know about. I will be showing you a handful to improve your usage of the CMD prompt.

The findstr command. This is just like the grep command for Linux.

findstr /s "BIS_C_OFFROAD" *.sqm

This is example usage of this command. Searching a text file for a certain string.

>findstr /s "HKEY" tools.txt
tools.txt: HKEY_CLASSES_ROOT\.pbo\DefaultIcon
tools.txt: HKEY_CLASSES_ROOT\.pbo\shell\Extract all
tools.txt: HKEY_CLASSES_ROOT\.pbo\shell\Extract PBO...
tools.txt: HKEY_CLASSES_ROOT\Folder\shell\create PBO\

And this is how to search multiple text files in a directory for a certain string.

>findstr /s /M "HKEY" *.txt
tools.txt
wordpress\backup-1.18.2012_06-19-59_bejiitas\backup-1.18.2012_06-19-59_bejiitas\homedir\.subversion\README.txt
wordpress\backup-1.18.2012_06-19-59_bejiitas\backup-1.18.2012_06-19-59_bejiitas\homedir\public_html\linux\lc\themhd.txt

The systeminfo command outputs all of the pertinent information about your computer system to the CMD prompt. Use it like this to put the information in the clipboard instead.

systeminfo | clip

List all hard drives on your Windows machine.

>fsutil fsinfo drives
 
Drives: C:\ D:\ E:\ F:\ H:\ I:\

Display the location of an executable on your Windows box.

>where notepad.exe
C:\Windows\System32\notepad.exe
C:\Windows\notepad.exe

This command executed in the CMD prompt will open Windows Explorer for the current directory.

start .

How to get the last boot up time of your machine.

C:\Users\Corporal Kerry\Documents>wmic os get lastbootuptime
LastBootUpTime
20171206071148.826810+660

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.