views:

67

answers:

1

I have a feeling I should be able add a directory to the PATH environment variable on an application-lifetime basis, but I can't find out how to do this. Is it possible to add a parameter to a Windows shortcut that appends a directory to the current value of PATH for use by the application being linked?

Cheers.

+1  A: 

Let the shortcut execute a batch file (.cmd), that

  • Sets the environment variable
  • execute the app
  • You use "START" to execute the app, this will start the app in another process, but it will copy the environment. You do not wait for the app to finish.
  • Now you can exit the batch file.

Should look like this:

@echo off
set path = %path%;C:\My Folder
start "Path to my exe"
GvS