如何在Windows中以不同的帐户启动exe [英] how to launch exe in differnt account in windows

查看:57
本文介绍了如何在Windows中以不同的帐户启动exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7中的(本地)用户帐户中启动了一个exe。

该exe将包含有关本地管理员帐户(Credentaials)的信息。

使用这个我需要再启动一个具有管理员权限的exe。

如何在Windows 7中实现这一点。

I am launching one exe in (local) user account in windows 7.
The exe will have info about the local admin account(Credentaials).
Using this i need launch one more exe with admin privileges.
How do achieve this in windows 7.

推荐答案

在Windows 7上,在管理员帐户下运行应用程序是不够的。此外,您需要启动作为管理员的应用程序。是的,这是一个完整的术语荒谬,但1)这是真的如何工作,2)这个概念和功能实际上是非常好的。我宁愿称之为特权提升。这与所谓的UAC有关:

http://en.wikipedia.org/wiki / User_Account_Control [ ^ ]。



现在,让我通过运行以管理员身份或提升来澄清我的意思。这:

http://www.sevenforums.com/tutorials/11841- run-administrator.html [ ^ ]。



显然,无论你做什么,都不可能以编程方式提升权限,否则就意味着UAC是不可能的。您可以做的一件事是从一开始就强制提升,这将显示UAC确认对话框而不点击以管理员身份运行。这是通过添加和正确配置application manifest 来完成的。具体如下:

http://msdn.microsoft.com/en- us / library / bb756929.aspx [ ^ ]。



-SA
On Windows 7, running application under administrator account is not enough. Additionally, you need to launch application "As Administrator". Yes, this is a total terminological absurd, but 1) this is really how things work, 2) this conception and feature is actually very good. I would prefer to call it "privilege elevation". This is related to what is called "UAC":
http://en.wikipedia.org/wiki/User_Account_Control[^].

Now, let me clarify what I mean by running "As Administrator", or elevation. This:
http://www.sevenforums.com/tutorials/11841-run-administrator.html[^].

Apparently, it is impossible to programmatically elevate privileges, no matter what you do, because otherwise it would mean that UAC is impossible. One thing you can do is to force elevation from the very beginning, which would show a UAC confirmation dialog without clicking on "Run As Administrator". This is done by adding and properly configuring application manifest. This is how:
http://msdn.microsoft.com/en-us/library/bb756929.aspx[^].

—SA


检查此链接。这是使用C#我不确定C ++中是否有相同的API。





http://stackoverflow.com/questions/6413900/launch-a-process-under-another-users-credentials [ ^ ]
Check this link. This is using C# I am not sure if same API are available in C++.


http://stackoverflow.com/questions/6413900/launch-a-process-under-another-users-credentials[^]


访问这里......



http://social.technet.microsoft .com /论坛/ scriptcenter / en-US / e20ddf85-26ba-45a7-a987-89de076eda23 / solve-run-program-as-different-user-through-batch-file?forum = ITCG [ ^ ]
visit here...

http://social.technet.microsoft.com/Forums/scriptcenter/en-US/e20ddf85-26ba-45a7-a987-89de076eda23/solved-run-program-as-different-user-through-batch-file?forum=ITCG[^]


这篇关于如何在Windows中以不同的帐户启动exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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