trying to create a dll which opens a file, originally i was trying to open batch file but it seems the process isnt executed when the dll is used by other program.
The code was tested in console application project and is working.
in the dll i put some logging but even though the logs are written the process does nothing.
I tried this simple code for example:
System.Diagnostics.Process.Start("C:\\QcOSD.txt\\");
tried other code like:
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = @"/C D:\test.bat";
p.Start();
p.WaitForExit();
not working when using the dll file on other program but working well on console application project.
EDIT:
possible solution that worked for me: allowing the service that runs the dll to interact with the desktop.
windows services > properties of the service running the dll > Log on > check "Allow service to interact with desktop".