I am having a weird problem with the PATH variable under windows:
My application is in a folder c:\app\bin and the DLLs for this application are in the c:\app\runtime folder. To run my program I modify the PATH variable with a *.bat file usually with the following script:
This will bring the executables and the DLLs on the path. However, on one of my Windows Server 2008 R2 systems this does not work. That means, if I execute the above command in a command window, I can start the exe file from c:\app\bin, but the application complains immediately that it cannot find some dll files required ("The program can't start because ....dll is missing from your computer ..."). These dll files should be in c:\app\runtime.
I experimented a little bit and it points out that there are three workarounds:
- Modify the PATH variable permanently using the System Properties dialog
- Omit the quotation marks in the above command for the path of the DLL files, e.g. set
- Copying the DLL files to the directory where the exe is located
The weird part about solution 2 is, that it does not change anyhing if I add quotation marks to the first path, or if I change the order of the paths.
Has someone a clue why my original script does not work? I need to get it run, because it is created automatically by a program and I cannot change the application that generates the bat file.