Tip:
Highlight text to annotate it
X
If you've been using Windows for a while, you may have discovered how useful the Run
prompt can be.
A lot of built-in Windows applications can be launched just by typing their name at a
command prompt, and the Run menu is just a one-line command prompt.
For example, if you type notepad, Windows will launch Notepad. The same goes for a number
of other utilities, including cmd for a command window, wordpad, mspaint, calc, and so on.
Some other applications are also accessible this way, including Word, Excel, PowerPoint,
and Photoshop.
In this video, I'm going to show you how to use this menu to your advantage by adding
your own command-line shortcuts.
Personally, I'm really into efficiency, and I don't have the Windows 7 taskbar at work,
so I use this technique pretty extensively.
To give you an example, I can type "nn" to launch notepad++.
I can type "dtop" to open an explorer window at my Desktop.
"fz" launches FileZilla. "udk" brings up a command prompt to a directory I use a lot.
There are many perfectly good ways to launch an application besides this one, but this
way is very fast and it doesn't require any external software.
Let me give you a brief explanation of how this works.
Windows keeps track of a number of environment variables, which exist at the operating system
level, outside of any single program.
You can echo these variables at the command prompt to see what values have been assigned
to them.
As an aside, one particularly useful one is CD, which evaluates to your current working
directory.
So if you're ever at a command prompt and you want to quickly open an explorer window
at your current location, just type "explorer %CD%".
Anyway, the environment variable we're interested here in is %PATH%.
Whenever Windows evaluates a command, it searches through all the folders listed in the PATH
to see if any file in those folders matches the command given.
If we put shortcuts into a folder that's included in the PATH, typing the name of one of those
shortcuts will execute it.
%PATHEXT% is a related variable that tells Windows which extensions it's allowed to count
as valid when we don't explicitly provide one.
So we have to make sure that .LNK is included if we want to access shortcuts without having
to type ".lnk" after their name.
So to set this up, you'll first want to create a central folder where you can store your
shortcuts. I already have one, but I'll add another one to demonstrate.
Now the easiest way to view and edit environment variables is under advanced system settings
in My Computer.
The Environment Variables window shows both user variables and system variables.
You'd probably want your shortcuts to be accessible system-wide, so you can edit the system variables.
In that list, you'll already have entries for PATH and PATHEXT.
All the entries are listed in a single string, with each entry separated by a semicolon.
So at the end of the PATH variable, type a semicolon and then add the location of your
shortcuts folder.
You'll also want to make sure that .LNK is listed in the PATHEXT variable.
Now you can add your shortcuts to the folder as usual.
I like to make things quick and easy to type, but use whatever names you feel are easiest
to both remember and type.
If you open a Run prompt now and type the name of one of your shortcuts, it'll launch
the application.
Thank you for watching, and enjoy being marginally more productive.