Alex Rivera | Logout

How can I make a program runnable from the commandline without typing its full path?

Asked 2009-07-17T19:32:06.787
11

I can best explain my question with an example. I recently downloaded Python for Windows, installed to C:\Python. So if I'm in folder X that contains myscript.py, and I want to invoke it, I have to call this:

> C:\Python\python.exe myscript.py

But it would be super-cool if I could just do this, from within any folder:

> python myscript.py

How do I make that "global"?

Edit
Report

1 Answer

4

Another possible solution would be to add an entry to the registry:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\python.exe

and then set the (default) value of that to the path (+ program name) where your python.exe resides, e.g. C:\Python\Python.exe.

That way, you can call python.exe from anywhere - no path or other stuff needed.

Marc

answered 2009-07-17T19:39:35.350

Your Answer