开发者

Process.Start() in C# does not work for non-admin users

开发者 https://www.devze.com 2023-03-12 03:59 出处:网络
I am trying to run explorer.exe to open a开发者_如何学运维 folder and I am using System.Diagnostics.Process to do that.

I am trying to run explorer.exe to open a开发者_如何学运维 folder and I am using System.Diagnostics.Process to do that.

It works fine if the application is ran by a user who has admin privileges but fails if the user is not an admin.

I have tried: - running it by supplying a ProcessStartInfo. - Getting the explorer.exe process from the local machine and running it using that. - Running it on IExplore.exe.

Nothing of the above worked for non-admin users. ProcessStartInfo lets you prompt for admin credentials but that's undesirable because many users are not admins..

I know I can make this work by using some native methods (I've tried it), SHOpenFolderAndSelectItems, but I don't really want to use native code..

0

精彩评论

暂无评论...
验证码 换一张
取 消