Beispiel #1
0
        private static void CreateProcess(string childProcName, IntPtr logonUserToken, string arguments)
        {
            string fileName            = Path.Combine(Path.GetDirectoryName(childProcName) + "", "ProcessAsUserWrapper.exe");
            string args                = Path.GetFileName(childProcName) + " " + arguments;
            var    userSpecificProcess = new UserSpecificProcess {
                StartInfo = new ProcessStartInfo(fileName, args)
                {
                    UseShellExecute = false
                }
            };

            userSpecificProcess.StartAsUser(logonUserToken);
        }
Beispiel #2
0
 private static void CreateProcess(string childProcName, IntPtr logonUserToken, string arguments)
 {
     string fileName = Path.Combine(Path.GetDirectoryName(childProcName) + "", "ProcessAsUserWrapper.exe");
     string args = Path.GetFileName(childProcName) + " " + arguments;
     var userSpecificProcess = new UserSpecificProcess {
         StartInfo = new ProcessStartInfo(fileName, args) { UseShellExecute = false }
     };
     userSpecificProcess.StartAsUser(logonUserToken);
 }