Starting another process with elevation using different user credentials

前端 未结 5 882
旧巷少年郎
旧巷少年郎 2021-02-04 02:00

I\'m trying to start an elevated process from with a non-elevated process, but I also need to supply the username and password for a user with administrative credentials. I\'ve

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 02:32

    The ProcessStartInfo.Verb="runas" is for only windows Vista and higher, so you should ask for the system level, and not do the elevation for XP.

    I think if you choose ProcessStartInfo.Verb="runas", you should not specify user name and password.

    If UAC is of, then it suppose to succeed anyway, it shouldn't be a problem.

提交回复
热议问题