views:

23

answers:

1

I want to use an environment variable as a commandline parameter in a debug session. So Project Properties->Debug->Command line arguments: %TEMP% gives me not the temp path as a parameter rather than the string "%TEMP%".

Of course I could resolve the environment variable to a path programmatically or copy past the correct path. But I want just to know, if an envvariable works and when, how it works?!

Does someone know how I can specify an envvar as a commandline parameter in VS debug commandline arguments?

A: 

If the program is launched by visual studio then it inherits VS's environment variables. VS gets its environment variables when it starts. So:

  1. Change/set the environment variable
  2. Restart Visual Studio
  3. Launch/debug your program
ChrisW
Sorry, but I don't want to have a specific envvar. I want to specify an envvar as a commandline parameter in a debug session.
Ephraim