Run Any Program Easily
Quick program access is important for productivity. Some of us have taskbars and start menus overflowing with shortcut icons. It’s not an ideal situation, often pushing users to seek out taskbar alternatives like these multifunctional docks.
Fortunately, there may be an answer that you hadn’t considered before. With a little bit of setup, you’ll be able to run any program that you want with a single command.
First, you have to create a new folder (such as C:\Shortcuts). This folder will hold the shortcuts that allow fast-access to any program on your system. Once created, we’ll need to add that folder to the system’s PATH environmental variable:
Now that the environment variable is established, all you have to do is create shortcuts to your programs, place those shortcuts in the C:\Shortcuts directory, and rename them as one-word commands.
Now, whenever you open up a command prompt, you can run those programs using those shortcut names. The command prompt’s current directory won’t matter. These shortcut commands will work from anywhere.
The label command offers a quick way to change the name of a drive on your system. It’s so simple that there isn’t much to explain about it. Just use it like so:
label [drive:] [name]
For example, if I wanted to name my main drive “MakeUseOf”, I’d run the following command:
label C: MakeUseOf
Modern file systems (e.g. NTFS) don’t need to be defragmented as often as file systems of the past (e.g. FAT32), but it’s still an important part of Windows maintenance, if you want to keep your system in tip-top shape. Be cautious with defragmentation of SSDs, though.
Though there are several excellent defragmentation utilities, you can still make do without them using the defrag command:
defrag [drive:]
That’s all. However, if you’d like a bit more diagnostic information while the defragmentation occurs, you can use the progress switch to print out progress to the prompt:
defrag [drive:] /U
And if you want as much information as possible, you can toggle the verbose switch:
defrag [drive:] /U /V
The chkdsk command (read: “check disk”) is a diagnostic tool that scans through your hard drives and tests for potential issues like corrupted data or physical damage. It’s just as easy to use as the defragment command above:
chkdsk [drive:]
Two useful parameters are the fix switch, which attempts to fix any encountered errors, and the recover switch, which will try to recover what it can if it encounters any bad sectors.
chkdsk [drive:] /F /R
While drive ejection is as simple as right-clicking on the drive and selecting Eject, sometimes this isn’t possible. For example, you may be stuck in Windows Recovery with no other option than to use the command prompt. What do you do then?
You can use the diskpart command (read: “disk partition”) to eject the drive:
When diskpart’s specialized prompt is ready, type list volume
to get a list of all drives currently recognized by your system. Take note of the drive’s ###, then type select volume [###]
according to the drive you want to eject. Make sure you only select drives that are marked “Removable” in the list.
Type remove all dismount
to eject the drive and exit
to end the specialized prompt. The drive should now be dismounted and safe to remove.
If you have trouble getting the system to recognize the drive again, repeat the process up until you’ve selected the volume, then type assign letter=[letter]
to remount the drive. For example, assign letter=I
would mount it as an I: drive.
A handful of tools enable a fast Windows search, but many of them are limited in that they only search through file names and not file contents. The findstr command is a simple way to achieve the latter, allowing you to locate files based on the text within those files.
This command is the most complex command on this list with over a dozen switches that alter how the search is performed. Too much to go over in a few paragraphs anyway, so here’s a complete overview and a few examples to show how the command can be used.
As you may already know, Windows associates particular file formats with programs so that those programs are used when said files need to be opened. The assoc command (read: “associate”) is an easy way to view and edit these file assocations.
Typing the command by itself will list all of the known file associations on your system. This can be useful for diagnostic purposes, otherwise it’s a bit too much information to digest at once. What it’s actually useful for is changing file assocations.
To view the association of an extension:
assoc [.ext]
To clear the association of an extension:
assoc [.ext]=
To set the association of an extension to another filetype:
assoc [.ext]=[filetype]
What is a filetype? For that you’ll need to use the ftype command, which lists all of the known filetypes on your system and which programs they’re associated with. So for example, on my system .TXT is associated as a txtfile and that filetype is opened using Notepad.