I am running my application (sample.exe) which uses an external DLL (i.e. I do not have the source of this DLL) on windows. External DLL generates some data in the %appdata%
folder. Everything runs fine when the application is run standalone.
Now, when I run the sample.exe using MPI the logs are getting generated in "C:\Windows\System32\config\systemprofile\AppData"
I understand that this is the %appdata%
for SYSTEM. Also, MPI uses "smpd"
service to run which needs to be installed as Administrator. So, I thought probably the sample.exe is owned by the system and not by the user. But, when checked from the task manager the owner of the application is still the user(%username%
).
I dont understand why are the logs generated in the system's appdata folder rather than the user's appdata folder.
Since sample.exe
is your own application, you can troubleshoot the problem by adding logging code. For example:
If the application data folder is correct but the environment variable isn't (this would be my first guess as to the problem) then you can try using SetEnvironmentVariable and/or _putenv to correct the path before loading the external library.