Is it possible to have whole or part of PATH environment variable specific to the type of running process's image (32bit/64bit)?
When I run some app from within 64bit cmd.exe I would like to have it pick the 64bit version of OpenSSL library whereas when I run some app from within 32bit cmd.exe I would like to have it pick the 32bit version of OpenSSL library.
| ||||
|
feedback
|
|
Make "%ProgramFiles%" to %ProgramFiles(x86)% env variable switching to work for you: Place folders with x32 and x64 versions of OpenSSL library into appropriate %programfiles% and %ProgramFiles(x86)% directories and in Path env. variable use reference to these folders via %programfiles% variable. This way, when you are running in x32-bit environment, your PATH entry %programfiles%/OpenSSL/ will automatically get resolved to %ProgramFiles(x86)%/OpenSSL/ on a disk. | |||||||||
feedback
|
|
Yes it is absolutely possible. Simply write a three .bat files. The first one should look like this:
The second and the third .bat file are basically the same, except they differ in their name. The first will be called x86.bat the second ia64.bat and they are placed in a folder called bin which is above the the first bat file. You will have this:
The content of the second and third .bat file should look like this:
You could create a link to first .bat file which will have the following settings: Target: %comspec% /k "PATH\first.bat" OPTION | Where OPTION is x86 or ia64 Start in: PATH | Where PATH is the PATH to your first.bat The script is the simplified script Microsoft uses to start the right command line for their Visual Studio environment. You could simply expand this scripts to N environments. By adding more .bat files for different environments and by editing the first.bat with more options and goto statements. I hope it is self explaining. And i hope Microsoft does not sue me for using their script. EDIT: Ah i think i misunderstood you a bit. For the 32bit cmd line the link should be created as: Target: %windir%\SysWoW64\cmd.exe "PATH\first.bat" x86 EDIT2: Try something like:
| |||||
feedback
|
|
I have had this problem and the answer is as follows: The path for your system variable on the 64 bit machines is On our 32 bit machines the environment variable companyprograms is You can do it through group policy or by script. | ||||
|
feedback
|