在Windows 7下使用Visual Studio的时候,经常会出一些莫名的错误,如使用Regsvr32注册ActiveX控件失败,主要的原因是没有用管理员权限,如何使程序运行时具有administrator 权限呢,具体如下:
下面的英文比较简单,就不翻译了。
Information
This will show you how to have a program
run as administrator with full elevated rights and privileges in
Windows 7.
A Standard user will still not be able to run a elevated program without getting a UAC prompt and having to enter the administrator's password.
A Standard user will still not be able to run a elevated program without getting a UAC prompt and having to enter the administrator's password.
Note
If a program that you are trying to run is giving you a
Access Denied or
No Permission type error, then running it as an administrator can usually give the program the permission it needs to run properly.
Warning
You should only allow a program that you trust to run as administrator. Once you have applied UAC permission, the program will have full access to your computer.
OPTION ONE
NOTE: This will allow you to temporarily run a program as an administrator once until you close it .
1. Press and hold Ctrl+Shift while opening the program.
2. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an Administrator.
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
OPTION TWO
NOTE: This will show you how to temporarily run a program as an administrator once until you close it .
1. Right click on the program's shortcut or an .EXE file, BAT file, CMD file, or MSI file, and click on Run as administrator. (see screenshot below)2. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an administrator.
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
OPTION THREE
NOTE: This will show you how to temporarily run a program pinned to the taskbar as an administrator once until you close it .
1. Right click on the icon of the pinned program on the taskbar to open it's Jump List. (see screenshot below)
2. In the Jump List, right click on the program's name, and click on Run as administrator. (see screenshot below)3. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an Administrator.
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
OPTION FOUR
NOTE: This will show you how to temporarily run a program as an administrator once until you close it .
1. Type in the file name (ex: cmd) of the program that you want to run elevated. (see screenshot below)2. Do either step 3 or 4 below.
3. Press Ctrl+Shift+Enter to open the program (ex: cmd) elevated, and go to step 5 below.
OR
4. Do OPTION TWO as above to right click on the program (ex: cmd) in the search results at the top of the Start Menu, and click on Run as administrator. (see screenshot below step 1)
5. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an Administrator.
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
OPTION FIVE
NOTE: This will show you how to always have the program run as an administrator when you open it .
1. Right click on the program shortcut or program .exe file, then click on Properties, and on the Compatibility tab. (see screenshots below)
NOTE: If you are doing this while logged on as a standard user instead of an administrator, then you will need to also click on the Change settings for all users button and type in the administrator's password.2. To Always Run this Program as an Administrator
A) Check the Run this program as an administrator box, and click on OK. (see screenshots above)3. To Not Always Run this Program as an Administrator
A) Uncheck the Run this program as an administrator box, and click on OK. (see screenshots below step 1)4. Open the program.
5. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an administrator.
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
OPTION SIX
NOTE: This will show you how to always have only this specific shortcut of the program run as an administrator when you open it, and not from any other shortcut or .exe of the program.
1. Right click on a shortcut that you want to run as administrator, and click on Properties.
2. Click on the Shortcut tab for a program shortcut, then cllick on the Advanced button. (see screenshot below)3. To Always Run this Specific Shortcut as an Administrator
A) Check the Run as administrator box, and click on OK. (see screenshot below)4. To Not Always Run this Specific Shortcut as an Administrator
A) Uncheck the Run as administrator box, and click on OK. (see screenshot above)5. Click on OK. (see screenshot below step 2)
6. Open the program.
7. If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an Administrator.
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
OPTION SEVEN
1. For how, use the RUNASADMIN value with the full path to the program's file in OPTION THREE here: How to Run a Program in Compatibility Mode in Windows 7