Tips & Tricks, Tutorials, Hacking, Troubleshooting,

We have previously shown you how to run programs as administrator with full elevated rights in Windows 7 (see our post, Run Programs as Administrator with Full Elevated Rights in Windows 7). This post shows you how to create a shortcut to run a program with elevated rights without having to go through the User Account Control (UAC) dialog box.

WARNING: You can only create this task and shortcut while logged in to an administrator account. It will not work in a standard user account.

To create this shortcut, you must first create a task that the shortcut will run. To open the Task Scheduler, open the Start menu and type the following into the Search programs and files box. Press Enter or click the resulting link.

taskschd.msc

Searching for the Task Scheduler

The Task Scheduler main window displays.

Task Scheduler main window

In the tree in the left pane, select Task Scheduler Library.

Selecting Task Scheduler Library

In the list of Actions in the right pane, click on Create Task.

Selecting Create Task

The Create Task dialog box displays. On the General tab, enter a name for your task in the Name edit box. We are creating a task to run CCleaner for this example.

NOTE: Make note of the name you assigned to the task. You will need it again later in this post.

Entering a name for the new task

To prevent the UAC dialog box from displaying when you run this task, select the Run with highest privileges check box do there is a check mark in the box.

Selecting the Run with highest privileges option

Select the version of Windows for which you want to configure this task from the Configure for drop-down list.

NOTE: This is similar to compatibility mode in Windows. If the program for which you are creating this task does not support running in Windows 7 normally, you can select the version of Windows that it does support instead.

Selecting the version of Windows

Click the Actions tab and click the New button to create a new action.

Clicking New on the Actions tab

The New Action dialog box displays. Make sure Start a program is selected from the Action drop-down list. Click the Browse button to the right of the Program/script edit box to select the program to start.

Clicking Browse on the New Action dialog box

On the Open dialog box, navigate to the folder containing the .exe file for the desired program. Select the .exe file and click Open.

Selecting the program's executable file

The full path to the selected program is inserted into the Program/script edit box. Click OK.

Closing the New Action dialog box

The action is added to the list of actions on the Actions tab.

Action added to the list

If you are running Windows on a laptop and using battery power, there are a couple of settings you might want to turn off. Click the Conditions tab. In the Power section, first click the Stop if the computer switches to battery power check box so there is no mark in the box. Then, select the Start the task only if the computer is on AC power check box so it is also empty.

Setting the Power options for laptops

Click OK to close the Create Task dialog box and save your changes.

Closing the Create Task dialog box

The new task displays in the list in the middle pane on the Task Scheduler main window.

New task added to the list

To close the Task Scheduler, select Exit from the File menu.

Closing the Task Scheduler

Now, we will create a shortcut on the desktop that will run the new task we created. Right-click in an empty space on the desktop and select New | Shortcut from the popup menu.

Creating a new shortcut

Enter the following line in the Type the location of the item edit box. Replace CCleaner with the name you assigned to your task.

schtasks /run /tn CCleaner

NOTE: There should be one space after schtasks, run and tn.

If you assigned a name with spaces to your task, put quotes around the name, as in the following example.

schtasks /run /tn “My Cleaner Program”

Click Next.

Typing the location of the item for the shortcut

Enter a name for your shortcut in the Type a name for this shortcut edit box. Click Finish.

Typing a name for the shortcut

Since the shortcut runs a different Task Scheduler executable file, the icon on the shortcut is not the icon for the program you chose. To change the icon, select Properties from the popup menu.

Getting the properties for the shortcut

On the Properties dialog box, make sure the Shortcut tab is active. Click the Change Icon button.

Clicking the Change Icon button on the Shortcut tab

A dialog box displays telling you that the executable file for the Task Scheduler contains no icons. Click OK to continue.

Task Scheduler has no icons available dialog box

We will select the icon from the executable file for which we are creating the shortcut. On the Change Icon dialog box, click the Browse button.

Clicking the Browse button on the Change Icon dialog box

On the dialog box that displays, navigate to the folder containing the executable file for which you are creating the shortcut. Select the .exe file and click Open.

NOTE: If you want to use a different icon other than the program’s icon, navigate to where the desired icon is saved and select it.

Selecting the executable file

The icons available in the selected .exe file display on the Change Icon dialog box. Select an icon and click OK.

Selecting the program's icon

You are returned to the Properties dialog box. Click OK to close it.

Closing the Properties dialog box

The new shortcut displays on the desktop. Click and drag the shortcut to where you want it located. When you double-click on the shortcut to start the program, you should NOT see the UAC dialog box.

New shortcut on the Desktop

If you no longer need or want the shortcut, you can delete the task and the shortcut. To delete the task, open the Task Scheduler as described earlier in this post. Right-click on the name of the task in the middle pane and select Delete from the popup menu.

Deleting the task

A confirmation dialog box displays. If you are sure you want to delete the task, click Yes.

Delete task confirmation dialog box

To delete the shortcut from the desktop, right-click on the shortcut and select Delete from the popup menu.

Deleting the shortcut

A confirmation dialog box displays. If you are sure you want to delete the shortcut, click Yes.

Delete Shortcut confirmation dialog box

The shortcut has not yet been permanently deleted. It has been moved to the Recycle Bin. To permanently delete the shortcut, right-click on the Recycle Bin and select Empty Recycle Bin from the popup menu.

Emptying the Recycle Bin

Another confirmation dialog box displays asking if you are sure you want to permanently delete the file, or the shortcut. If you are sure, click Yes.

Delete File confirmation dialog box

Be careful when bypassing the User Account Control (UAC) dialog box and allowing programs to have full access to your computer. Be sure you trust the program and that you know what you are doing and what the program is doing. [via Windows Seven Forums]

No comments:

Post a Comment