RSS

How-To Geek

Have you ever wondered why you can just type ipconfig into a command prompt and it works, but when you want to use a command line program you downloaded you have to navigate to its directory? Here’s how to fix that.

Adding a Folder To Your PATH

Open Computer and right-click on any white space, then select properties from the context menu.

When the System section of Control Panel opens, click on the Advanced system settings hyperlink in the left hand pane.

Then you will need to click on the Environment Variables button.

The variable we are looking for is a System variable called Path, once you have found it, click on the edit button.

In order to add an entry to your path, you need to precede the folder name with a semi-colon. For example, if i want to add the How-To Geek folder which is on the root of my C drive to my path i would the following to the end of the Variable value field:

;C:\How-To Geek

Now i can access any content within the How-To Geek folder without having to drill down into the directory.

Comments (8)

I did this ~15 years ago on a machine that ran DOS 5. I hacked the hell out of the AUTOEXEC.BAT file. PATH and PROMPT both. Especially PROMPT. IIRC, my prompt looked something like this:

”
It is 04:07 on Saturday, 14 July 2012
What is thy bidding, my master?
PATH>
”

Lots of fun.

A similar trick I employed in Win95 was, I made a folder with a bunch of shortcuts to my apps, with 1-3 letter names, and I hid the file somewhere and added it to PATH, and printed out a list of the names and what they would open. My “launcher” was Win+R, code, Enter. I know Launchy can replicate that, sort of, but I don’t really care for the style anymore.

Why have they never fixed the dialog box, so you can actually see the path when you are trying to edit it?It is easier to copy the whole path string elsewhere, edit it and paste it back, than to use the tiny texbox provided

One item of note: a single path is still limited to 260 characters. I’ve heard of examples where this was exceeded because of long folder names along with deep nesting. Path command itself is limited to 8191 characters, a command prompt limitation not usually reached. See-http://support.microsoft.com/kb/830473

I am using winXP. When I tried, none of the windows shown in your article appeared. Still I proceeded to click on advanced, for whatever windows were opened, from DeskTop or File Explorer. Presently I am editing config.nt from dos window. Is there any alternative to this.

Since I’ve already added C:\Bat to the Path statement (using minimum # of characters), I don’t need to go back and edit the Path statement for each program I may want to use.

Back in the day, I used to get a lot of mileage using ANSI.SYS not only for color, but also to re-program some of the F-keys to print out the name of a DOSKEY macro (for short batch files) and also to hit the Enter key to execute it. Nowadays, I use TCC/LE from JPSoft to try and get some of that functionality at the command prompt.

So, instead of adding multiple program directories to the Path statement, just add one for your batch files. Then you can put multiple batch files in the PATH environment, without having to keep changing the Path statement.

Question: Is there a way to set it so that I don’t have to type .lnk at the end of my shortcuts that are in the path folder? IE: like the way you don’t have to type .exe at the end of exe files to run them?

GEEK TRIVIA

DID YOU KNOW?

Despite what the term “pencil lead” would have you believe, lead is not and was never actually used in the writing tips of pencils; the pencil lead might have always been lead free but the paint wasn’t. As a result, school children in the early 20th century could get lead poisoning from excessive chewing of their pencils.