如何从管理进程以当前用户权限运行进程 [英] How to run a process as current user privilege from an admin process

查看:122
本文介绍了如何从管理进程以当前用户权限运行进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当安装程序(由Inno Setup构建)启动某个进程时,该进程始终以管理员权限运行. -因为安装程序已以admin身份运行.

我想以当前用户的特权运行子进程.
有什么好方法吗?

解决方案

尽管这不是最佳实践(甚至不是很好的实践),但是可以从高级/管理员IL流程启动中等IL流程:

在代码项目上查看此帖子

我可以确认此代码在启用和不启用UAC的Vista 32和64位系统上都能正常工作.

When a setup program(built by like Inno Setup) does launch a process, the process always be run as administrator privilege. -because setup program had been run as admin.

I want to run the child process as current user's privilege.
Is there a good way?

解决方案

Although it is not considered best practice (or even good practice), it is possible to launch a medium IL process from a high/admin IL process:

See this post on codeproject

I can confirm that this code works on Vista 32 and 64-bit with and without UAC enabled.

这篇关于如何从管理进程以当前用户权限运行进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆