Impersonating in .net (C#) & opening a file via Process.start

后端 未结 1 1039
时光取名叫无心
时光取名叫无心 2021-01-23 18:45

HI, I was doing some impersonation using the LogonUser as it was explained in numerous places.

(I used the great class library introduced here, but the prin

相关标签:
1条回答
  • 2021-01-23 18:59

    This smells like a problem with ProcessStartInfo.LoadUserProfile. It defaults to false, with the side effect that the started process will see the HKCU registry settings of your account, not the impersonated one. Office programs are not going to like this.

    Beware that afaik you'll also have to set UseShellExecute to false to make this setting effective. That will hamper your ability to start Word by simply passing a .doc file as the file name. You'll need to use "winword.exe" instead.

    0 讨论(0)
提交回复
热议问题