Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Windows doesn't seem to keep my system environment variables

25 Jul 2010   #1

Windows 7 64bit
Windows doesn't seem to keep my system environment variables

Hi all,

As far as I can tell, my problem seems to be quite simple. The solution, however, may not be quite as simple.

The application I am trying to make work is python 3. I also have python 2 installed, but that works fine.

The problem is at the command prompt I would like to be able to type
and have it launch the python 3 shell. Currently, all I get is
'python3' is not recognized as an internal or external command,
operable program or batch file.
If I type
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on
Type "help", "copyright", "credits" or "license" for more information.
it already launches python 2 (which is correct).

I have already tried to put python3 as a system and user environment variable, in AFAIK the same way as python is set up. I changed this at the system properties window and then going to environment variables on the "Advanced" tab.

if I type
at the command prompt, I believe it should confirm this (please correct me if i'm mistaken)
So, have I done something wrong, or left a step out? Please let me know if you need more info.

I should point out that typing a hard link to python3 using the address above does work, but I would like the shortcut for convenience (and to work out why it doesn't work in the first place)

My system for the record is Win7 64bit. Although both python installations are 32 bit versions (although i'm fairly sure that is trivial)


My System SpecsSystem Spec
26 Jul 2010   #2

Windows 7 Ultimate x64

I have never done anything like you are attempting to do. (Setting up an alias for an executable)

I would tackle the problem by creating .cmd or .bat files that are in the path that then calls the proper executable and passes along all parameters.

For example, your batch file for python 3 would be called python3.bat (captain obvious to the rescue ) and you would include the following code:

C:\Python31\python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
I'm not sure you need to include all of those command line parameter pass-throughs but it can't hurt.
My System SpecsSystem Spec
26 Jul 2010   #3

Windows 10 Pro X64

Add C:\Python31 to the end of the existing path environment variable. You do this by adding a ; (semi colon) then the path to C:\Python31. That will make it accessible from a Command Prompt.
My System SpecsSystem Spec

26 Jul 2010   #4

W10 Pro desktop, W10 laptop, W10 laptop, W10 Pro tablet (all 64-bit)

In order to access your environment variable from the command line you need to bracket it with % like this: %python3%. In order to use the environment variable in a batch file you need to bracket it with %% like this: %%python3%%
My System SpecsSystem Spec
27 Jul 2010   #5

Windows 7 64bit

Woah thanks! Some good working solutions.
ZTruker has suggested the one that is most like the original though. I looked in the path variable to find C:\Python26, and added C:\Python31 and now it works exactly as expected.

the batch file method and the %python3% method both worked well too.
My System SpecsSystem Spec

 Windows doesn't seem to keep my system environment variables

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar help and support threads
Thread Forum
Environment Variables
Hi I set up a User defined Enviro. Var. called GomFolder to be C:\Users|Damo\MyDocuments\NinjaTrader 7 See the attached clip 2015-01-23_1242 - Judge101010's library My understanding is that this should set up a folder called GomFolder in the NinjaTrader 7 folder. Is this correct? If...
General Discussion
Windows 7 Environment Variables List
Environment Variable Path %ALLUSERSPROFILE% C:\ProgramData %APPDATA% C:\Users\{username}\AppData\Roaming %COMMONPROGRAMFILES% C:\Program Files\Common Files %COMMONPROGRAMFILES(x86)% C:\Program...
Performance & Maintenance
Windows 7 Environment variables
Is there an Environment variable that can tell me where the Documents folder is located? Typically, the Documents folder is located in C:\Users\username\Documents. I am creating a batch file to copy 1 file from a remote location (another computer in the network) to the Documents folder. Since...
General Discussion
What are Environment Variables in Computer?
Hey, Can anyone explain are environment variables are within the Advanced System Settings of Computer? I've had to create a new environment variable for a Java complier, and I was just wondering what exactly are environment variables are and why are they used? Thanks, Harry P.S I've...
General Discussion
Edit Environment Variables via command line
I know how to udpate my environment variables using the stupidly slow to navigate windows. This is pointlessly slow IMHO. How do i type a command, ONCE, that will update/add an environment variable that does not need to be retyped every time i open a new CLI session. The SET command seems...
Performance & Maintenance
Java, Windows 7 & Environment Variables
I have installed Java in Program Files (x86) > Java > jre > bin In Environment Variables, I accidentally deleted the default PATH variable. This is what I currently have in the PATH variable: Please can someone tell me what the default PATH was? I will add this in front of the Java path. ...

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:34.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App