Skip to content

Instantly share code, notes, and snippets.

@7MinSec
Created April 25, 2019 00:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7MinSec/be4d902c4e797f76f5cd510bc700ceda to your computer and use it in GitHub Desktop.
Save 7MinSec/be4d902c4e797f76f5cd510bc700ceda to your computer and use it in GitHub Desktop.
Windows command line shortcuts and tips

As heard on 7MS #357

Windows command line shortcuts and tips:

Creative ways to play with cmd

Basically, you can do Windows Key + R then type cmd and Enter for quick access to command line.

But lets do some more fun stuff. Wanna open a command window from the desktop and launch a command in one swoop? Try this:

cmd /k <command>

For example:

cmd /k ping 192.168.0.1

The cmd /k part opens a command window, and then ping 192.168.0.1 can be whatever command you also want to run on the fly.

And if you want to start programs and/or open files right from the command line, you can do that (in most cases) by just typing the program name, like:

notepad

Or, get really fancy and add a document name after the command. For example:

notepad meow.txt

If meow.txt doesn't exist, Notepad will simply ask you to create it!

Finding files faster

Call me crazy, but the Windows find/search feature sometimes doesn't find stuff that I know is there. So I still like using old school DOS commands for this. I might do something like:

cd \
dir /s *brian*.doc

The dir stands for directory, and the /s tells the system to search recursively.

I also like this one:

dir /s *brian*.doc /p

This one does a recursive search for brian.doc and then the /p tells the system to pause one screen at a time. Kind of like the Linux more command.

Shutdown/reboot with style

Who needs to use the mouse when you can just do Windows Key + R and then

shutdown -r -t 1

This tells the system to reboot with a countdown timer of 1 second (so pretty much right away).

Quick ways to get to important stuff

Wanna jump right to the network control panel but don't wanna dig through various control panel menus?

Do Windows Key + R plus:

ncpa.cpl

Boom! Opens the network control panel.

I also like Windows Key + R plus:

diskmgmt.msc

That brings up the disk management interface so you can resize/format/rename disks, etc.

How about jumping right to the local users/groups on the machine so you can make adjustments - like cough not making everybody a local admin! Just do Windows Key + R plus:

lusrmgr.msc

An old boss of mine said he remembered this shortcut by thinking of "loser manager" ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment