Jump to content
xisto Community
yordan

How To Change Your Windows User Environment Variables a step-by-step guideline

Recommended Posts

1. INTRODUCTION.

Most of Microsoft very basic users are satisfied when the Windows installer installs each new software, automatically putting each file in the right place and making each Windows registry change.

However, some new incoming software environment, mainly the ones from the open world, let you do some changes manually. For instance, if you install the java development software on your pc, you have to manually tell windows where the java binaries are. That means, if you type “javac” in a command shell window, Microsoft Windows has to know that javac.exe is in c:\myfiles\mythings\job\java\bin.

More precisely, c:\myfiles\mythings\job\java\bin has to be added to your PATH environment variable.

Some software packages (the ones I personally prefer) are now delivered as a simple bunch of files. If you want to use sql*plus, you get the files from Oracorp, you put them where you prefer, and you run from there. If you want to be able to run them from averywhere, the PATH environment variable has to also include this place.

If you want to use sql*net in order to be able from your PC to reach a remote database, the location of your tnsnames.ora description file has to be known by windows. This is done by the environment variable TNS_ADMIN you have to teach Windows.

That’s why it’s useful for you to know how to change the Microsoft Windows standard environment variables (like PATH) or add your own ones (TNS_ADMIN in my current topic).

Here I will tell you how to do the job.

2. NOW LET’S GO.

First of all, have a look at your Windows desktop (the screen appearing when you just booted your PC, before touching everything). Find the “my computer” icon, right-click on it, and select “Properties” .

Posted Image

This opens the “system properties”. Posted Image

Click the “advanced” tab, you see the “Environment variables

 

Posted Image

Now you see the “User Variables” button, click it, the Environment Variables changer menu appears.

 

Posted Image

Choose the “User variables for” part, click “New”, this opens a new window.

In the “Name” field type TNS_ADMIN

And in the “Value” field type c:\oracle\client

In the “System Variables” field choose Path, then click “Edit”

At the end of the value, add a semicolon (“;”) like the old values have, and then enter C:\oracle\client (if you were entering the oracle client addons path) and c:\myfiles\mythings\job\java\bin.

3. THAT’S ALL, FOLKS.

The job is done. Close the window, and in order to verify open a “cmd” command line window. In the cmd window, type “set”.

You will see a lot of thinghs, alle the user and system variables your windows session uses. Amongs them you will see the two values you entered :

Path=c:\.........; c:\myfiles\mythings\job\java\bin.

TNS_ADMIN=c:\oracle\client.

Share this post


Link to post
Share on other sites

Sorry for these who think that these instruction are really basic.
But you really need you to know how to do this in order to understand my next tutorial, which is located here :
http://forums.xisto.com/topic/96271-topic/?findpost=1064395371
This made my other tutorial smaller, I simply say "please update your Path user variable" and "please add the TNS_ADMIN variable pointing to the folder you just created".

Share this post


Link to post
Share on other sites

Regarding the system path environment variable, i don't say that it is not correct but it is not absolutely necesary to change this system variable because you can get exactly the same result if you simply add another user environment variable called path and enter as its value the same value that you use with the system path variable.Also, i think that it would be possible to do this if you use a login script, but it is more complicated.BTW, do you remember the autoexec.bat and autoexec.nt files????Best regards,

Share this post


Link to post
Share on other sites

Regarding the system path environment variable, i don't say that it is not correct but it is not absolutely necesary to change this system variable because you can get exactly the same result if you simply add another user environment variable called path and enter as its value the same value that you use with the system path variable.

Of course, you are partly right. Maybe I was not fully clear in my main topic text. I did not want to fully change it, I wanted to add a new value to the system path variable.When you just add a binary file named "sqlplus.exe" in the c:\oracle\client folder you just created, Windows cannot know that you placed your binaries there. So, if you want to simply type "splqplus" instead of typing it's full pathname c:\oracle\client\sqlplus.exe, it's location must included in the Path variable, else Windows will answer "file not found".
Same thing if you want to use the portable version of OpenOffice located on your USB flashdisk, E:\OpenOfficePortable must be added to your environment if you want to use the software without typing cd e:\blahblah first.
This is rather classical in the Unix/Linux way of thinking, you must edit your .profile or .bashrc environment file and add a new folder in your PATH string. What is nice is that you can also work this way to windows, simply you use my topic instead of type "vi .profile" or "vi .login" like in Linux.
For instance in my topic concerning how to access a remote Oracle database, the path to sqlplus.exe must be added in the Path variable. I emphasize that it must be added, and not replacing. And it must be in the system environment in order to be usable by any user, else you will have to change it for each user.

Share this post


Link to post
Share on other sites

Of course, you are partly right. Maybe I was not fully clear in my main topic text. I did not want to fully change it, I wanted to add a new value to the system path variable.When you just add a binary file named "sqlplus.exe" in the c:\oracle\client folder you just created, Windows cannot know that you placed your binaries there. So, if you want to simply type "splqplus" instead of typing it's full pathname c:\oracle\client\sqlplus.exe, it's location must included in the Path variable, else Windows will answer "file not found".
Same thing if you want to use the portable version of OpenOffice located on your USB flashdisk, E:\OpenOfficePortable must be added to your environment if you want to use the software without typing cd e:\blahblah first.
This is rather classical in the Unix/Linux way of thinking, you must edit your .profile or .bashrc environment file and add a new folder in your PATH string. What is nice is that you can also work this way to windows, simply you use my topic instead of type "vi .profile" or "vi .login" like in Linux.
For instance in my topic concerning how to access a remote Oracle database, the path to sqlplus.exe must be added in the Path variable. I emphasize that it must be added, and not replacing. And it must be in the system environment in order to be usable by any user, else you will have to change it for each user.

Ok, i understand your point better, but, as i said before, you got the same functionality if you add it to the user environment variables instead to the system variables, the difference is that if you add it to the system variables it will be available to all of the users that can access that computer, while in the other case, it will be only available to the user that set it up.

BTW, i took the time to read your other post, and it helps me to completely understand your point, also, i think that both topics are very helpful for everybody. Nice work :rolleyes:.

Best regards,

Share this post


Link to post
Share on other sites
i still canHow To Change Your Windows User Environment Variables

I follow your instruction above, and I made it for my administrator user.

but I got a problem with my limited user. When I double click the same program, the administrator user is directly run the program,

but if I logged on as a limited user, the will be a msgBox "Invalid Picture"..

hope u can help me

-question by b1nt4n9

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.