Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: A problem with Environment Variables  (Read 4188 times)

0 Members and 1 Guest are viewing this topic.

Johnfairweather

    Topic Starter


    Newbie

    • Experience: Experienced
    • OS: Windows 7
    A problem with Environment Variables
    « on: January 23, 2016, 11:23:02 AM »
    In my Environment Variable (on my Windows 8.1, x64 PC), I have set up -

    1) A variable of "Python27", with a value of "c:\python27".
    2) A variable of "Python35", with a value of "C:\users\john fairweather\appdata\local\programs\python\python35-32"

    Where Python27 & Python35 are folders.

    Opening up CMD (Version 6.3.9600), I would have expected that on entering "Python27" or "Python35", I would have got to these directories, but I am not, I am receiving the message "'Python27' is not recognised as an internal or external command, operable program or batch file."

    Please advised what I have done wrong.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: A problem with Environment Variables
    « Reply #1 on: January 23, 2016, 11:37:41 AM »
    Environment Variables are referenced by enclosing them in percent signs. so %Python27% for example. The contents of the variable can be considered to replace the location you have them in your command. So, for example, if you used %Python27% as is, it would be the same as just typing C:\python27 which would give the same error. You would need to use them in conjunction with an appropriate command. In this case, CD (Change Directory), such as
    Code: [Select]
    cd %Python27%
    I was trying to dereference Null Pointers before it was cool.

    Johnfairweather

      Topic Starter


      Newbie

      • Experience: Experienced
      • OS: Windows 7
      Re: A problem with Environment Variables
      « Reply #2 on: January 23, 2016, 12:56:26 PM »
      Thanks, that was the answer I wanted.

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: A problem with Environment Variables
      « Reply #3 on: January 23, 2016, 01:58:54 PM »
      You can make a sort of 'alias' in windows to open a directory.
      You have  a folder with some horrible long path name.
      You make a shortcut by sending it to the desktop as a shortcut.
      Rename it to something clever and short.
      Move it to the C:\windows directory.
      Now you can run it and it will open the directory for you.

      Just trying to help.  :)