Question

When I start firefox from command line, i does not matter in which directory I am. When I want to start for example lazarus i need to go to directory where file lazarus.exe is located.

Why can I start firefox.exe from everywhere and some other .exe files i must go to right directory

C:\Users\Seda> start firefox.exe       // run perfectly
C:\Users\Seda> start lazarus.exe       // can not find exe file
C:\Users\Seda> cd ..
C:\Users> cd ..
C:\>cd Lazarus
C:\Lazarus> start lazarus.exe // .exe file started
Was it helpful?

Solution

What Firefox does is to add the path to its executable to the "App Paths" subkey, which is the preferred solution against modifying the 'path' environment variable. To make the same for lazarus, you can add a

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\lazarus.exe

key having the (Default) value of the path to the executable, e.g.: X\...\lazarus.exe

To have an effect on all users, you can use the machine counterpart of course

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths


See documentation for more details.

OTHER TIPS

You must setup the path in the Windows environment. quick google got me this link - http://www.computerhope.com/issues/ch000549.htm

Could it be that your firefox has been added to the environment variable which is why you can start it anywhere without specifying the full path

check under Control Panel » System » Advanced » Environment Variables

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top