Yesterday, we learned about Environmental Variables. Today I’ll show you how to create your own and edit the ones that ship with Windows!
Why Should I Make My Own?
Creating your own Environmental Variables can be very useful! Let’s say you want a quick and easy way to access the same folder repeatedly, we’ll use the example of a backup drive: We can create a variable to point to a specific folder. We’ll use this example: You have a second hard drive in your machine, this drive’s sole purpose is to store backups for all users on your computer. The path to your documents in the backup folder on this drive is:
n:\backup\users\john\documents
This address is not very long, but it can be a pain when you have to type or navigate to it repeatedly - and we’re geeks, we like the quickest, easiest way to do everything! Wouldn’t it be easier to just type:
%backupdocs%
Of course it would! Start off by hitting the Windows Key+R and typing this command:
sysdm.cpl
You can also reach this location by navigating to Control Panel->Performance and Maintenance->System or right-click on My Computer and choose “Properties” - but remember: Geeks=Fast (just don’t tell my wife
). Click the Advanced tab, then click the “Environmental Variables” button.

In the Environmental Variables dialog, under “User Variables for <User Name>”, click the “New” button.

Type the variable name (what you’ll type when you want to call the variable) and the value (what the variable points to).

Click the “OK” button in all dialogs. Changes should be immediate!
Vista Only Tip Permanently Change A Variable Via The Command Prompt
Vista
Using the set command from the command prompt (read: in a batch file), you can make permanent changes to environment variables. Example: to change to location of the %backupdocs% variable to G:\john, the command would be:
setx path "%backupdocs%;G:\john"
Again, this permanently changes the location of the variable, so be careful!
Edit: XP
Apparently you can use the set command with a command-line tool called setx.exe which is included in the Windows XP Service Pack 2 Support Tools. I haven’t tested this so your mileage may vary!
ooh, you’ve switched to vista =0
i’ve never used these before… what exactly do we type? just %backupdocs% and it will bring us to the folder? and this is still in the run prompt right?
Yep! The main purpose for these is when you’re creating a batch file - but you can use them as shortcuts (like I wrote about) too!
hey saman, i’d like to ask why you use alexa redirect a lot. what’s the benefit?
I was testing to see if it would increase my rank, it seems to be working!
Hi saman, this is perfect tip, i should translate this one too for Turkish friends:)
@robinson; redirects are useful for high alexa traffic rank.
But i have another question: will redirects affect pagerank calculation?
hmmm dotnetnuke.. for the pagerank calculation maybe you’ll lose negligible pagerank if you’d lose even a little pagerank! just my opinion ofcourse.