.exe need directory after adding it to user environment variable


  1. Posts : 36
    Windows 10
       #1

    [solved] .exe need directory after adding it to user environment varia


    I added a command program to a directory that's not listed in what's displayed after I do the command
    Code:
    echo %path%
    . As I intend to use that program multiple times I'd like somehow its name, what's before .exe, to work no matter the current directory of the command-line. I made a search and it seems that I should add an entry to Environment Variables, in the System Properties tab Advanced, so I added one with the program name as name and its directory as its data then rebooted. Since then when I enter its program name anywhere but its directory I get
    'PROGRAM_NAME' is not recognized as an internal or external command,
    operable program or batch file.
    How can I change settings so I can execute the program in any directory ?

    I'm on Win 10 Pro 22H2.

    Thank you kindly
    Last edited by DynV; 23 Feb 2023 at 23:19.
      My Computers


  2. Posts : 17,103
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #2

    Did you add the desired path to
    Control panel,
    System,
    Advanced system settings,
    Advanced tab,
    System variables section,
    Edit,
    New

    That does not require any "name" to be declared, just the path.

    I have the feeling that you have not edited the contents of the Path variable as you had intended but have, instead, created a new variable that has the name of your program.

    All the best,
    Denis
      My Computer


  3. Posts : 36
    Windows 10
    Thread Starter
       #3

    The website mentioned making a--new--one would work, so I made a new one, I don't know the details of what was the variable, but I made a new as instructed. I thought that it would be added to the path when the command-line window was created. Do I need to discard the instructions of that site and directly edit the path? Also I made the new in the user section, am I required to use the system section?
      My Computers


  4. Posts : 17,103
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #4

    To avoid the response

    DynV said:
    'PROGRAM_NAME' is not recognized as an internal or external command,
    operable program or batch file.
    you have to add your chosen program's folder path to the Path variable.

    That's what I provided instructions for.

    The procedure you appeared to use added a new variable instead. That does not achieve what you said you wanted.

    When you have finished, you'll be able to enter the command
    Code:
    echo %Path%
    and see your new entry in the list.

    All the best,
    Denis
      My Computer


  5. Posts : 17,103
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #5

    DynV said:
    The website mentioned making a--new--one would work, so I made a new one
    , I don't know the details of what was the variable, but I made a new as instructed.
    There was a misunderstanding somewhere along the line.
    Those instructions were about creating a new variable.

    DynV said:
    I thought that it would be added to the path when the command-line window was created.
    No, you created a new variable that has nothing to do with the Path variable.

    DynV said:
    Do I need to discard the instructions of that site and directly edit the path?
    Yes & Yes.

    DynV said:
    Also I made the new in the user section, am I required to use the system section?
    If there are no other users then it makes no difference.
    If there are other users & the change needs to apply to them as well then it must be done in the System variables section.

    All the best,
    Denis
      My Computer


  6. Posts : 36
    Windows 10
    Thread Starter
       #6

    I think I misunderstood the site and it was a new path entry, as I created one then it worked. I marked this thread as solved, thanks again.

    Update 1
    Well I tried to, I renamed the OP and it didn't change the thread name.
      My Computers


  7. Posts : 17,103
    Windows 10 Home x64 Version 22H2 Build 19045.5371
       #7

    DynV said:
    Well I tried to, I renamed the OP and it didn't change the thread name.
    To mark it as Solved, use the button in the bottom-left of this webpage.
    .exe need directory after adding it to user environment variable-mark-solved-button-shown-foot-page.png


    All the best,
    And thanks for the rep,
    Denis



    Welcome to TenForums.

    It's really worth making time to browse through the Tutorial index - there's a shortcut to it at the top of every page.
    - At the foot of the Tutorial index is a shortcut to download it as a spreadsheet.
    - I download a new copy each month.
    - By downloading it as a spreadsheet I can benefit from Excel's excellent filtering capabilities when I search for topics of interest.
    - Tutorials are also listed by category at Tutorials - there's also a shortcut to that at the top of every page.
    - Both tutorial lists are searchable.
    - You can also search for TenForumsTutorials in many general search engines, such as Google, by adding site:tenforums.com/tutorials after your search term. For example,
    taskbar toolbars site:tenforums.com/tutorials

    You can search TenForums using the search box in the top-right corner of all TenForums webpages or using Advanced Search - TenForums
    - You can also search TenForums threads in many general search engines, such as Google, by adding site:tenforums.com after your search term. For example,
    Search for drivers by HardwareID site:tenforums.com
    - [This is what the search box in the top-right corner of TenForums webpages does automatically]
    Last edited by Try3; 24 Feb 2023 at 00:08.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:26.
Find Us




Windows 10 Forums