1

I would like to integrate my program into the Command Interpreter in Windows 10 (preferably without registry edits). I have done minimal work with Libraries, but I still could write a DLL if that is necessary in any way. I would like to run my program, lets call it "speedtest" for this example. I would like to type the following in the Command Prompt to run it:

speedtest

Much like entering "py" into the Command Prompt with Python installed will open the Shell environment, I would like to do the same thing with my programs. Any way to do this easily?

2 Answers2

2

Add your utility's Path to the environment variables list.

To do so, in Windows 10 and Windows 8

  • In Search, search for "System" and then select: System (Control Panel) Click the Advanced system settings link.
  • Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  • In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Santhosh
  • 729
  • 7
  • 19
1

All python and similar programs are doing is adding the location of the executable to the PATH environment variable (while that may or may not be stored in the registry, its not exactly a registry edit, you can do it through the Windows GUI).

You will discover this when the automatic process fails for some reason because you have to add it to PATH yourself.

The command interpreter is very simple, it looks in the current directory for the command you input and then checks PATH. If there isn't a program with the same name as your command in either of those places, it will throw an error.

There just isn't any other way to hack it. Either add your program's location to PATH or write an installer to do it for you.

BradleyDotNET
  • 60,462
  • 10
  • 96
  • 117