如何以管理员身份自动运行 程序
2012-03-29 19:49
525 查看
1. runas 命令要输密码,所以还是不行
2.创建shortcut,右击属性设置成管理员运行的话,直接点击可以以管理员身份运行,但是如果放到task 里面运行的话还是不行,最后运行的还不是管理员身份
3.用c#,参数可以自己穿,不过运行的话,UAC必须disable 掉
例如
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
ProcessStartInfo proc = new ProcessStartInfo();
proc.UseShellExecute = true;
proc.FileName = @"C:\Users\DailyRun.bat";
proc.WorkingDirectory = @"C:\Windows\System32\";
proc.Verb = "runas";
Process.Start(proc);
}
}
}
二:disable UAC
If you feel a little guilty when you disable the UAC - join the club. Many techies:
a) Get rid of the nagging 'Continue' pop-up message box.
b) Feel shamefaced at turning off this Windows Server 2008 security feature.
c) Sometime later, they realize that the UAC is necessary for security, and turn it back on.
Microsoft's introduction of UAC reminds me of the governments introduction of seat belts in the 1970s. Both were unpopular at first, but eventually, the majority see the advantages of safety over ease-of-use.
As someone who hated the UAC at first, I can say that now I have turned it back on, firstly, it's not THAT irritating, secondly it sends a subliminal message 'Guy work securely'. Thirdly, as an unexpected bonus the delay, or pause, that UAC introduces
makes me think more about the action I am about take. - No bad thing!
Local Policy - Elevate without prompting
Run all administrators in Admin Approval Mode
Registry Hack - ConsentPromptBehaviorAdmin
How to Activate the Hidden Windows Server 2008 Administrator Account
not joined to the a domain see below.
Stage 1) Preliminary task:
Our first task is simply to launch the Local Security Policy snap-in. You have the choice of two methods:
Method A) Begin by clicking on Windows Server 2008's Start button, then type secpol.msc in the Start Search dialog box. Note: you must include the .msc extension.
See more on Secpol
Method B) The goal is to display Windows Server 2008's Administrative Tools. Firstly, right-click the Taskbar, select Properties. Next navigate this path: Start Menu, Customize, Advanced; scroll to the bottom and find System Administration
Tools, place the radio button next to 'Display on the All Programs menu'.
Stage 2) Configure the Security Options
![](http://www.computerperformance.co.uk/images/server_2008/local_security_policy.jpg)
Open the Local Security Policy. (See Method A or B above)
Expand the Local Polices folder, see the screenshot opposite.
Drill down to Security Options folder.
Scroll down, and locate the family of settings beginning with 'User Account Control'.
Focus on: User Account Control: Behaviour of the elevation prompt for administrator. Double click and set to: Elevate without prompting. Check the screenshot below.
Restart you Windows Server 2008 computer.
When the computer restarts, try to configure a tasks that needs UAC. For example, change the computer's display name. Press the Windows Key + Pause / Break. Select the 'Change Settings' shield.
UAC should now be turned off, thus you should not see the 'Continue' box.
2.创建shortcut,右击属性设置成管理员运行的话,直接点击可以以管理员身份运行,但是如果放到task 里面运行的话还是不行,最后运行的还不是管理员身份
3.用c#,参数可以自己穿,不过运行的话,UAC必须disable 掉
例如
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
ProcessStartInfo proc = new ProcessStartInfo();
proc.UseShellExecute = true;
proc.FileName = @"C:\Users\DailyRun.bat";
proc.WorkingDirectory = @"C:\Windows\System32\";
proc.Verb = "runas";
Process.Start(proc);
}
}
}
二:disable UAC
If you feel a little guilty when you disable the UAC - join the club. Many techies:
a) Get rid of the nagging 'Continue' pop-up message box.
b) Feel shamefaced at turning off this Windows Server 2008 security feature.
c) Sometime later, they realize that the UAC is necessary for security, and turn it back on.
Microsoft's introduction of UAC reminds me of the governments introduction of seat belts in the 1970s. Both were unpopular at first, but eventually, the majority see the advantages of safety over ease-of-use.
As someone who hated the UAC at first, I can say that now I have turned it back on, firstly, it's not THAT irritating, secondly it sends a subliminal message 'Guy work securely'. Thirdly, as an unexpected bonus the delay, or pause, that UAC introduces
makes me think more about the action I am about take. - No bad thing!
Local Policy - Elevate without prompting
Run all administrators in Admin Approval Mode
Registry Hack - ConsentPromptBehaviorAdmin
How to Activate the Hidden Windows Server 2008 Administrator Account
Local Policy - Elevate without prompting
For computers that have joined a domain, 'Elevate without prompting' is the best Local Policy method for disabling the UAC pop-up. For Windows Server 2008 Home Editions, or any Windows Server 2008snot joined to the a domain see below.
Stage 1) Preliminary task:
Our first task is simply to launch the Local Security Policy snap-in. You have the choice of two methods:
Method A) Begin by clicking on Windows Server 2008's Start button, then type secpol.msc in the Start Search dialog box. Note: you must include the .msc extension.
See more on Secpol
Method B) The goal is to display Windows Server 2008's Administrative Tools. Firstly, right-click the Taskbar, select Properties. Next navigate this path: Start Menu, Customize, Advanced; scroll to the bottom and find System Administration
Tools, place the radio button next to 'Display on the All Programs menu'.
Stage 2) Configure the Security Options
![](http://www.computerperformance.co.uk/images/server_2008/local_security_policy.jpg)
Open the Local Security Policy. (See Method A or B above)
Expand the Local Polices folder, see the screenshot opposite.
Drill down to Security Options folder.
Scroll down, and locate the family of settings beginning with 'User Account Control'.
Focus on: User Account Control: Behaviour of the elevation prompt for administrator. Double click and set to: Elevate without prompting. Check the screenshot below.
Restart you Windows Server 2008 computer.
When the computer restarts, try to configure a tasks that needs UAC. For example, change the computer's display name. Press the Windows Key + Pause / Break. Select the 'Change Settings' shield.
UAC should now be turned off, thus you should not see the 'Continue' box.
![](http://www.computerperformance.co.uk/images/server_2008/prompt_consent.jpg)
相关文章推荐
- 如何自动以管理员身份运行.NET程序?
- 如何自动以管理员身份运行程序
- 如何自动以管理员身份运行.NET程序?
- 如何使DELPHI程序在Win7下自动请求以管理员身份运行
- 如何自动以管理员身份运行.NET程序?
- 如何自动以管理员身份运行.NET程序?
- 如何让Delphi程序启动自动“以管理员身份运行"
- 如何自动以管理员身份运行.NET程序?
- C#程序如何以管理员身份自动运行
- 如何自动以管理员身份运行.NET程序?
- 如何自动以管理员身份运行.NET程序
- 如何自动以管理员身份运行.NET程序?
- 如何让 Windows 8 的程序双击后自动以管理员身份运行
- 在VS中如何让C#语言编写的程序自动以管理员身份运行
- C#程序如何以管理员身份自动运行
- Delphi Xe2 后的版本如何让Delphi程序启动自动“以管理员身份运行"
- win7上运行某程序的时候,如果这个程序需要以管理员的身份运行,那么就会有“用户帐户控制”的提示:“您想允许来自...发布者的以下程序对此计算机进行更改吗?”请问,win7如何知道哪些程序需要以管理员的身份运行?
- C#如何以管理员身份运行程序(转)
- C# 让程序自动以管理员身份运行
- C#如何以管理员身份运行程序