如何将软件提升为管理员权限? [英] How can raise a software to administrators rights?

查看:598
本文介绍了如何将软件提升为管理员权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是以前问过的,也已经回答了,但是我不知道如何搜索,所以我一个人问.

创建软件时,可以将其安装或直接放置在C:\下,或者为什么不创建一个像C:\ mysoftware \这样的子文件夹,它也可以正常工作.
但是,当您在程序文件文件夹下安装它(我有一堆免费的安装程序软件)时,您创建的软件突然被拒绝在其自己的文件夹中读取或写入文件,但在C:\ mysoftware这样的文件夹中运行良好\.

因此,对于我的问题,我如何授予软件管理员权限(或提升为该状态),以便可以将其安装在Program Files文件夹下并正常工作?

我正在这里搜索代码或类似的代码,尽管它可以通过右键单击该软件来赋予软件管理员权限(这不是我想要的解决方案)来工作.(

This has probably been asked before and also been answered but I don''t know how to search for it so I ask it by myself.

When you create a software you can install it or put it directly under C:\ or why not a subfolder you have created like C:\mysoftware\ and it works fine.
But when you install it (I have a bunch of free installer-software) under the program files folder the software you have created is suddenly denied to read or write files within its own folder, but works well in a folder like C:\mysoftware\.

So to my question, how do I give the software the administrator rights (or raise to that state) so it can be installed under Program Files folder and work properly?

I''m searching for codes here or something similiar though it works by giving the software the administrator rights by right clicking on it (which is not the solution I want).

推荐答案

AFAIK.这不能由代码控制.
您需要特别要求管理员授予您在文件夹中安装程序的权限,否则他可以为您安装程序.
AFAIK. this cannot be controlled by code.
You need to specifically request an administrator to give you rights to install a program in a folder, or he can install the program for you.


您好,

从Vista发行以来,对程序文件文件夹的访问受到限制.如果确实确实需要允许您的应用程序将文件写入Program Files文件夹中,则可以更改该文件夹上的安全设置.最好的解决方案是更改软件代码,以使其在其他位置写入文件...但是,如果您无法做到这一点,则可以通过以下方法更改安全设置:

Hi,

Since the release of Vista access to the program files folder is restricted. If you really, really need to allow your application to write files in the program files folder, you could change the security settings on the folder. The best solution would be to change the software code so that it write files somewhere else... but assuming you can''t do that, here is how to do change the security settings:

icacls "c:\Program Files\my program\*" /grant theUserName:(F)



该批次必须在提升状态下运行. (即在安装过程中,或通过以管理员身份运行CMD).

再一次,这是不好的做法,只有在找不到替代方法的情况下,才应该这样做.

阅读本文以获取详细参考:

http://technet.microsoft.com/en-us/library/cc753525(WS .10).aspx [ ^ ]

Valery



This batch has to be ran in an elevated state. (ie during installation, or by running CMD as an administrator).

Once again this is bad practice, and you should only do this if you can''t find an alternative.

Read this article for detailed reference:

http://technet.microsoft.com/en-us/library/cc753525(WS.10).aspx[^]

Valery


您无法使用该程序执行此操作.最简单的方法是右键单击有问题的exe文件,然后选择属性".在随后的对话框中,单击兼容性"选项卡.在那里,您会找到一个以管理员身份运行该应用程序的选项.您还可以使程序提示用户进行管理员访问,并且有几种解决方法. Google是您的朋友.
You can''t do it from with the program. The easiest way is to right-click the exe file in question, and select Properties. In the subsequent dialog box, click he Compatibility tab. There, you will find an option to run the app as administrator. You can also cause the program to prompt the user for admin access, and there are a few ways to go about it. Google is your friend.


这篇关于如何将软件提升为管理员权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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