View Full Version : How do you edit the windows environment variable?
Shadow Skill
7th September 2004, 12:37 AM
I want to edit my environment variable so that I can open a run prompt and type the name of a program and have it execute. Firefox seems to already do this without my manipulating anything and I want to know how to do this for other programs. I already know wherre to go to edit the environment variables in xp pro but I just cant remember what I have to do to get a given program to launch from the run prompt upon typing its name. [In short I want to mimick the way *nix systems implement the run prompt, so I can get rid of more desktop icons. :D ]
Does anyone know what I have to do? I tried adding the full path to the given exe to the path variable and it didnt work, I tried making my own with the absolute path and that didn't work either..I'm lost.
Ps. I really need this since I have started to use virtual desktops in windows more often and can't always see my desktop icons...
crackers
7th September 2004, 12:48 AM
You're kidding, right?
In case you're not, path-variables work pretty much the same: they should point to the directories where the executables are stored. They're quite simple on *nix systems because there's a set number of "places" where most programs go (e.g. /usr/bin, /usr/local/bin). On Windows, there isn't this restriction and executables get put where-ever they want to be. If you try to capture all the executables in Windows in this fashion, you'll run out of environment space.
Shadow Skill
7th September 2004, 12:54 AM
well I am not trying to get every single program I have to work that way, I just need to know how to add programs of my choice to get windows to act the way I want (Damnned lack of customization..) I did it before but I can't remember how...sigh
jimbo
7th September 2004, 01:06 AM
an easy way to do this is with aliases...
In your home directory edit the .bashrc file or if you want all the users on your system to have it then edit the /etc/bashrc file.
you can setup aliases to commands you run often and even setup comands with the command line switches you like.
for example... I like the "ls" command to use the "-lah" switches so I have an alias setup for "ls" like this:
alias ls='ls -lah'
if you want to have a shortcut to a program you run like the tribes2 game then you can setup an alias like this:
alias t2='/usr/local/games/tribes2/tribes2'
Maybe that is what you are looking to do.
Shadow Skill
7th September 2004, 01:22 AM
while this information will probably come in handy when I am using Fedora.....I was kind of looking for how to do this using windows and not a *nix system.... :(
Jman
7th September 2004, 06:45 PM
Perhaps you can try making an "executable directory" and coping all of your .exes there, then adding that directory to your path. The problem is many programs depend on stuff in the executable's directory. Maybe you could copy the contents of every directory in Program Files to one directory. In either case you would break many settings that rely on programs being installed in a certain place.
You could specify every directory that has an exe in it in the PATH variable. You're limited to 1024 characters, 2048 after a patch or SP2 (http://support.microsoft.com/?kbid=832978).
This is one case where it is a lot easier on Linux, due to the nature of the software packages putting executables in one place.
Mat
7th September 2004, 07:02 PM
to modify the path: http://www.computerhope.com/issues/ch000549.htm
however, if a program is poorly programmed (after all, we're talking about windows here :)) it might use the path where you issued the command - say c:\ - as the actual path for the application and will thus might be missing some files, which are already there...
a better idea would be to use good old batch files.. for each program you want to be able to run, create a file progname.bat in c:\batches (or whatever) with the following content:
@echo off
c:\
cd \path\to\application\dir
start program.exe
cd\
then add c:\batches to your path
Mat
Shadow Skill
7th September 2004, 09:03 PM
Actually I managed to do it by editing the registry. (very annoying.)
I agree Jman now if only Linux would find required libraries all of the time........
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.