设置应用程序以启动所有用户的管理员 [英] Set an App to start up as admin for all users

查看:53
本文介绍了设置应用程序以启动所有用户的管理员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


有没有人知道如何将应用程序设置为以任何用户的管理员身份启动?

Does anyone know how to set an application to startup as admin for any user?


我尝试过Windows任务时间表但是...... - 如果我选择的话要在管理员帐户上运行,任务无法启动非管理员登录 - 如果我选择在具有最高权限的用户帐户上运行,则该任务将以管理员用户身份运行,但不适用于非管理员
用户

I've tried Windows Task Schedule but .. --if I choose to run at Administrators account the task doesn't start for non admin log ons --If I choose to run at Users Account with Highest privileges the task runs as admin for admin users but doesn't for non admin users


我的应用程序是否可以作为任何用户的管理员运行?(其中一个管理员用户应该允许我的应用程序执行此操作,但他们可以做它只有一次?)

Is there any thing I could for my app to run as admin for any user? ( of corse one of the admin user should allow my app to do that , but can they do it only once? )


我的目标是Windows 7,8和8.1

My Target is Windows 7 , 8 and 8.1


如果根本不可能,请发送链接到可获得此信息的官方来源吗?

If it is not possible at all could you please send a link to a official source where this information is available?



为什么我的应用程序需要以管理员身份运行?

我需要控制某些管理窗口的隐藏和显示(For Instance,Send SW_SHOW,SW_HIDE for一个精心设计的cmd提示符)

Why My app needs to run as Admin?
I need to control Hide and Show for some admin windows ( For Instance , Send SW_SHOW, SW_HIDE for a elavated cmd prompt)

推荐答案

您好,

您可以将它放在System32文件夹中将所有应用程序作为管理权限启动,或者您可以创建一个驱动程序,正常启动应用程序然后执行令牌提升。这种方法可能要复杂得多,虽然
- 这使您可以更好地控制此功能。 

You can put it in System32 folder which starts up all applications as Administrative privileges, or you can create a Driver which starts up the application normally then performs a token elevation. This method may be much more complicated and hard although - this gives you much more control over this feature. 

还有一些注册表位置可以打开具有管理权限的所有子键。

There is also few registry locations available which open all their child-keys with Administrative privileges.

或者你可以使用CreateProcessWithLogonW函数可能会获得管理员的密码和用户名,并将其存储起来以便在之后重新使用它。

Or you can use CreateProcessWithLogonW function which may get the password and username of Administrator and store it for re-use it to elevate after then.

MSDN 文档:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682431.aspx

问候

Rohan Vijjhalwar  

Rohan Vijjhalwar 


这篇关于设置应用程序以启动所有用户的管理员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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