J
Juanma Lopez
Guest
Using ProcessStartInfo to start Office apps under different user stopped working since last update. Now Process.Start(processStartInfo) is throwing this exception:
System.ComponentModel.Win32Exception (0x80004005): A specified logon session does not exist. It may already have been terminated
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
I tried another approach using directly Win32 calls, having same result:
CreateProcessWithLogonW("user", Environment.MachineName, "password", LogonFlags.WithProfile, @"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE", "", 0, null, null, ref startupInfo, out _processInfo);
Always returning ERROR_NO_SUCH_LOGON_SESSION while executing on Windows 10 2004, working fine in previous Windows versions.
Continue reading...
System.ComponentModel.Win32Exception (0x80004005): A specified logon session does not exist. It may already have been terminated
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
I tried another approach using directly Win32 calls, having same result:
CreateProcessWithLogonW("user", Environment.MachineName, "password", LogonFlags.WithProfile, @"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE", "", 0, null, null, ref startupInfo, out _processInfo);
Always returning ERROR_NO_SUCH_LOGON_SESSION while executing on Windows 10 2004, working fine in previous Windows versions.
Continue reading...