Table of Contents

Command Prompt

MD5/SHA256 Hash

certUtil -hashfile FILENAME [SHA256|MD5]

cmd.exe

Apparently cmd.exe no longer has a default startup script. According to Stackoverflow you have to configure it in the registry. Add a string value named AutoRun to one of these keys and set the value to the full path of the startup script.

HKCU\Software\Microsoft\Command Processor
HKLM\Software\Microsoft\Command Processor
HKLM\Software\Wow6432Node\Microsoft\Command Processor

Yes, I should probably learn Powershell but I have enough shit to learn and powershell uses insanely long hyphenated commands. I know you can tab complete but still, WTF? Also, after being Windows-free and generally Microsoft free for five years and coming back, I've realized that Microsoft makes shit. The issue is largely the UI. I like having a lot of options but the MS UIs are sooo freaking busy that I can never find anything.

Dir Sort Order

From CLI use /o:GN. Make it permanent with setx DIRCMD “/o:gn” or otherwise adding an environment variable like set DIRCMD=“o:gn”, perhaps in that startup script I mentioned above.

Home Folder

echo %HOMEDRIVE%%HOMEPATH% will echo your home drive and folder.

Network Info

netsh is a PITA with it's long, mutli-level syntax but it gives better answers than ipconfig for a lot of things.

This will give you a cutdown version of ipconfig.

ipconfig /all | findstr "IPv4 adapter Physical Server Name"

ip info

WLAN BSSID

Routing table

MAC

For Loop Ping Sweep

From: https://www.rubyguides.com/2012/02/cli-ninja-ping-sweep/

 for /L %i in (1,1,255) do @ping -n 1 -w 200 192.168.1.%i > nul && echo 192.168.1.%i is up.

As you can see the idea is the same, -n being the equivalent of -c in Linux’s ping and -w is the timeout, then we send the output to nul and echo only if the ping command was successful (that’s what the && is for)

User Info

Reload in 5

# reboot windows in 5 minutes
shutdown /r /t 300
# abort shutdown
shutdown /a

To change the Windows PATH

setx PATH "path with quotes if there are spaces (there are)"

Line count (like wc -l)

What is the Windows equivalent of "wc -l"?

find /c /v ""