您可能需要经常运行需要管理员权限的应用程序,这总是会触发UAC(用户帐户控制(User Account Control))提示。您不想每次都单击是(Yes)或输入管理员密码(administrator password),也不想禁用UAC,因为它可以保护您的计算机。当使用应用程序更新程序、命令行工具或游戏启动器来运行 Fortnite 或英雄联盟(Fortnite or League)等(Legends)在线游戏时,这尤其令人讨厌。游戏(Game)启动器会将您正在玩的游戏更新到最新版本,并且通常会触发UAC 提示(UAC prompt)。这是停止UAC的方法(UAC)在不禁用UAC的情况下征求您对特定应用程序和游戏(apps and games)的许可:
步骤 1. 启动任务计划程序
(Log)使用具有管理员权限的用户登录。然后,运行任务计划程序(Task Scheduler)。如果您不知道我们如何发布关于此主题的单独指南:在Windows中启动(Windows)任务计划程序(Task Scheduler)的 9 种方法(所有版本)。
如果您不想阅读其他指南,一个快速的方法是在Windows中搜索(Windows and click)“任务计划程序”("task scheduler") ,然后单击或点击相应的搜索结果(search result)。
步骤 2(Step 2)。为要在没有UAC提示的情况下运行的应用、游戏或文件(game or file)创建计划任务
在“任务计划程序(Task Scheduler)”窗口中,单击或点击右侧“操作(Actions)”列中的“创建任务” 。("Create Task")将显示创建任务(Create Task)窗口,您可以在其中为Windows 计算机(Windows computer)创建高级任务。
在“创建任务”窗口的“(Create Task)常规(General)”选项卡中,在“名称”字段中键入任务的名称(Name)。让它简短易记。稍后您需要任务名称(task name),因此请记下它,如果您很快就会忘记。然后,确保选中“以最高权限运行”(Run with highest privileges")框,以便以管理权限运行任务。然后,使用“配置为”("Configure for")下拉列表选择您正在使用的Windows版本。(Windows)在我们的例子中,它是Windows 10。
转到“创建任务(Create Task)”窗口中的“操作(Actions)”选项卡。在那里,单击或点击新建(New)按钮,以设置任务执行的操作。将显示“新建操作”(New Action)窗口。
单击或点击浏览(Browse)并选择您希望任务运行的文件的路径。这可以是您想要在没有UAC提示的情况下运行的应用程序或游戏的可执行文件。(app or game)在我们的示例中,我们选择了Fortnite游戏中使用的EpicGamesLauncher.exe 。选择文件后,按Open。
您将返回“新建操作”(New Action)窗口。在这里,您可以看到指向您刚刚选择的文件的路径。按确定(OK)。
如果您在笔记本电脑、平板电脑或其他带电池的设备上安排任务,请转到“创建任务(Create Task)”窗口中的“条件”(Conditions)选项卡。在那里,查找“电源(Power)”部分并取消选中“仅当计算机使用交流电源时才启动任务”的设置。(Start the task only if the computer is on AC power.)这可确保任务始终运行,无论您的笔记本电脑或平板电脑(laptop or tablet)是否使用电池或它连接到电源插头(power plug)。
转到“创建任务(Create Task)”窗口中的“设置”(Settings)选项卡。在这里确保选中“允许按需运行任务”("Allow task to be run on demand")选项。这可确保当您双击在下一步创建的快捷方式时,任务会运行。此外,如果任务已在运行,请在底部选择“不要启动新实例” 。(Do not start a new instance")单击(Click)或点击确定。
使用您提供的名称和设置(name and settings)创建任务。
Step 3. 测试任务是否运行良好
在Task Scheduler中,双击(或双击)左侧列中的Task Scheduler Library 。在应用程序窗口(app window)的中间,您可以看到所有存在的任务。找到您创建的名称,然后单击或点击(click or tap)其名称。然后,在右侧的Actions面板中,单击或点击(Actions)Run。
该任务应该运行并启动您选择的文件,具有管理权限,并且没有UAC 提示(UAC prompt)。如果它不这样做,那么您应该重新开始并注意我们的所有指示,以免您错过任何东西。
第 4 步(Step 4)。创建计划任务的快捷方式
下一步是使用创建快捷方式(Create Shortcut)向导为您刚刚创建的任务创建快捷方式。我们在本指南中详细解释了如何创建快捷方式:如何在Windows中为应用程序、文件、文件夹和网页创建快捷方式。创建快捷方式时,在“键入项目的位置”("Type the location of the item")字段中,键入:schtasks.exe /run /tn "Task Name"。任务名称(Task Name)需要是任务的实际名称。在我们的例子中,我们输入:schtasks.exe /run /tn "Fortnite"。然后,按下一步。(Next.)
输入快捷方式(shortcut and press) 的名称,然后按Finish。
快捷方式已创建,但它有一个丑陋的图标。您可以使用本指南中的说明将其更改为您想要的任何内容:如何更改Windows中任何快捷方式的图标。
当您双击或双击快捷方式时,它会以管理员权限运行所选文件,而不会触发UAC 提示(UAC prompt)。享受!
您使用这种方法运行什么应用程序、游戏或文件(game or file)?
这并不难,不是吗?有点(bit time)费时,但绝对值得付出努力,尤其是当您经常使用需要管理权限的应用程序或文件时。(apps or files)如果您是以管理员身份运行Powershell的(Powershell)网络管理员(network administrator),这将特别有用。在结束本教程之前,请在评论中告诉我们您正在使用此方法运行哪些应用程序。我们很想知道。
Use the Windows Task Scheduler to run apps without UAC prompts and admin rights
You may need to frequently run an app thаt requires administrator permissions, whіch always triggеrs a UAC (User Αccount Control) prompt. Yoυ do not want to click Yes or enter the administrator password every time, and you do not want to disable UAC either, because it protects your computer. This is especially annoying when using app updaters, command line tools or game launchers for online games like Fortnite or League of Legends. Game launchers update the game you are playing to the latest version, and often they trigger a UAC prompt. Here is how to stop UAC from asking for your permission for specific apps and games, without disabling UAC:
Step 1. Start the Task Scheduler
Log in with a user that as administrator permissions. Then, run the Task Scheduler. If you do not know how we have published a separate guide on this subject: 9 ways to start the Task Scheduler in Windows (all versions).
If you do not feel like reading another guide, a quick method is to search for "task scheduler" in Windows and click or tap the appropriate search result.
Step 2. Create a scheduled task for the app, game or file that you want to run without UAC prompts
In the Task Scheduler window, click or tap "Create Task" in the Actions column on the right. The Create Task window is shown, where you create advanced tasks for your Windows computer.
In the General tab of the Create Task window, type a name for your task in the Name field. Make it something short and easy to remember. You need the task name later, so write it down, if you tend to forget quickly. Then, make sure to check the box that says "Run with highest privileges" so that the task is run with administrative permissions. Then, use the "Configure for" drop-down list to select the version of Windows that you are using. In our case, it is Windows 10.
Go to the Actions tab in the Create Task window. There, click or tap the New button, to set an action that is performed by the task. The New Action window is shown.
Click or tap Browse and choose the path to the file that you want the task to run. This can be the executable file of an app or game that you want to run without UAC prompts. In our example, we chose the EpicGamesLauncher.exe used in the Fortnite game. After you select the file, press Open.
You are back to the New Action window. Here you see the path towards the file that you just selected. Press OK.
If you are scheduling the task on a laptop, tablet or some other device with a battery, go to the Conditions tab in the Create Task window. There, look for the Power section and uncheck the setting that says "Start the task only if the computer is on AC power." This ensures that the task runs at all times, no matter whether your laptop or tablet is using the battery or it is connected to a power plug.
Go to the Settings tab in the Create Task window. Here make sure that the option "Allow task to be run on demand" is checked. This ensures that when you double-click on the shortcut that you create at the next step, the task is run. Also, on the bottom, choose "Do not start a new instance" if the task is already running. Click or tap OK.
The task is created with the name and settings that you have provided.
Step 3. Test if the task runs well
In Task Scheduler, double-click (or double-tap) on the Task Scheduler Library, in the column on the left. In the middle of the app window, you see all the tasks that exist. Find the one you created and click or tap on its name. Then, in the Actions panel on the right, click or tap Run.
The task should run and launch the file that you selected, with administrative permissions, and without a UAC prompt. If it does not do that, then you should start over and pay attention to all our instructions, so that you do not miss something.
Step 4. Create a shortcut to the scheduled task
The next step is to use the Create Shortcut wizard to create a shortcut to the task you just created. We explain in detail how to create shortcuts in this guide: How to create shortcuts for apps, files, folders and web pages in Windows. When you create the shortcut, in the "Type the location of the item" field, type: schtasks.exe /run /tn "Task Name". Task Name needs to be the actual name of the task. In our case, we typed: schtasks.exe /run /tn "Fortnite".Then, press Next.
Type a name for your shortcut and press Finish.
The shortcut is created, but it has an ugly icon. You can change it to anything you wish, using the instructions from this guide: How to change the icon of any shortcut in Windows.
When you double-click or double-tap on the shortcut, it runs the selected file with administrator permissions, without triggering a UAC prompt. Enjoy!
What app, game or file do you run with this method?
This wasn't that hard, was it? A bit time consuming but definitely worth the effort, especially if you are often working with apps or files that require administrative permissions. This can be especially useful if you are a network administrator who runs Powershell as admin. Before closing this tutorial, tell us in a comment, which apps you are running using this method. We are curious to know.