setting "path" in environmental variables

GeejBud

New member
Joined
Oct 16, 2006
Messages
3
Programming Experience
Beginner
I have an application that is calling an executable with the following:

Process.Start("C:\temp\some_application.exe ", argument_string)

This works fine, but I would like "some_application.exe" to run without specifying the full path, such as:

Process.Start("some_application.exe ", argument_string)

If I set up the directory in "path" in Windows Environment variables, I can run it correctly from a command line or Dos prompt without specifying the path as expected.

However, my code does not seem to be referencing the environmental variables and cannot find the .exe file in the case above. Any suggestions?

 
If "some_application.exe" is in a path relative to your executing exe you can always try:

strPath = Application.StartupPath
Process.Start(strPath & "\some_application.exe", argument_string)

Or a modification of strPath may be necessary, such as backing up one directory. ("\..\"). Again, that's only if some_application is relative to your exe, which it may not be.

 
Back
Top