“Register” an .exe so you can run it from any command line in Windows

后端 未结 17 2599
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 02:38

How can you make a .exe file accessible from any location in the Windows command window? Is there some registry entry that has to be entered?

相关标签:
17条回答
  • 2020-11-28 03:08

    You have to put your .exe file's path into enviroment variable path. Go to "My computer -> properties -> advanced -> environment variables -> Path" and edit path by adding .exe's directory into path.

    Another solution I personally prefer is using RapidEE for a smoother variable editing.

    0 讨论(0)
  • 2020-11-28 03:14

    Put it in the c:\windows directory or add your directory to the "path" in the environment-settings (windows-break - tab advanced)

    regards, //t

    0 讨论(0)
  • 2020-11-28 03:16

    Windows 10, 8.1, 8

    Open start menu,

    1. Type Edit environment variables
    2. Open the option Edit the system environment variables
    3. Click Environment variables... button
    4. There you see two boxes, in System Variables box find path variable
    5. Click Edit
    6. a window pops up, click New
    7. Type the Directory path of your .exe or batch file ( Directory means exclude the file name from path)
    8. Click Ok on all open windows and restart your system restart the command prompt.
    0 讨论(0)
  • 2020-11-28 03:17

    You need to make sure that the exe is in a folder that's on the PATH environment variable.

    You can do this by either installing it into a folder that's already on the PATH or by adding your folder to the PATH.

    You can have your installer do this - but you will need to restart the machine to make sure it gets picked up.

    0 讨论(0)
  • 2020-11-28 03:18

    Add to the PATH, steps below (Windows 10):

    1. Type in search bar "environment..." and choose Edit the system environment variables which opens up the System Properties window
    2. Click the Environment Variables... button
    3. In the Environment Variables tab, double click the Path variable in the System variables section
    4. Add the path to the folder containing the .exe to the Path by double clicking on the empty line and paste the path.
    5. Click ok and exit. Open a new cmd prompt and hit the command from any folder and it should work.
    0 讨论(0)
提交回复
热议问题