A service launches an exe program successfully using this code:
using (Process myProcess = new Process()) {
myProcess.StartInfo.WorkingDirectory = processFolderPath;
myProcess.StartInfo.FileName = "PROCESS_1.exe";
myProcess.StartInfo.CreateNoWindow = false;
myProcess.Start();
}
From PROCESS_1
, I'd like to open a folder:
Process.Start(@"C:\Users\mainuser\Documents\folder_to_open");
This works if the PROCESS_1
is started normally by double clicking the exe or as admin. But it fails to open a folder, if PROCESS_1
is started from service and is running as SYSTEM
.
Is it possible to open a folder in explorer if the process trying to open a folder is run as SYSTEM from a Service?