Wednesday, May 23, 2007

How to launch a program always elevated under Vista UAC


This tip comes from our documentation team on how to launch a program that requires the use of some system files.

UAC is there for a reason, and I suggest only using this method if you know what you are doing and are ok with lowering the security level of your system!!

So now the warnings are out of the way, how do you create a shortcut that doesn't prompt you to run every time? Let's try creating one for the command prompt in Administrator Mode. Although this proceedure can be used for any application that is naughty for writing data into a system location, or that doesn't have a shim built for it to catch the data and write it into a better location.

These steps will require you are running as a local admin, with UAC enabled

  1. Start the Task Schedule from Start, All Programs, Accessories, System Tools, and finally click on Task Scheduler

  2. Accept the UAC prompt for running the Task Scheduler

  3. Click Create Task... (be careful not to click Create Basic Task)

  4. On the General, enter a Name and description, and ensure the Run with highest priviledges is checked similar to the following screenshot:



    Ensure you copy the name into the clipboard as you will need it later when building the shortcut.

  5. Leave the Triggers tab empty

  6. On the Actions tab, ensure you set an action to start a new program:

    • Ensure Action is set to Start a Program.

    • Browse to the path of the program, in thise case c:\windows\system32\cmd.exe.

    • Click OK

    Similar to the following screenshot:


  7. On the Conditions tab, uncheck all the boxes.

  8. On the Settings tab, make sure only Allow task to be run on demand, and If the task is already running, then the following rule applies is set to Do not start a new instance

  9. Click OK

  10. Right-Click on the desktop and choose New, Shortcut from the context menu.

  11. When it asks for the location of the command, type in schtasks /run /TN "Command Prompt in Admin Mode". Please note that "Command Prompt in Admin Mode" is the exact string name of the scheduled task you created and copied above, similar to the following screenshot:


    And then follow through the rest of the wizard with whatever friendly name you want for the shortcut

Now each time you click on this icon, the command prompt will open in admin mode without prompting for UAC.

Again, I recommend if you can deal with the UAC prompt, you do so! This should be used as a last resort for those customers who can't handle the prompt because they open the application 100s of times a day.

-------------------------------

A cheap web hosting may mean more to spare on advertising, but compromising on the hosting means compromising on features like internet phones and online backup. In search engine optimization, it is important that domain registration is followed by the website design. Naturally for all this to happen, the hosting should be reliable.
-------------------------------

3 comments:

Anonymous said...

This runs from the Task Scheduler, but not from the shortcut, on Home Premium.

Anonymous said...

I have the same issue. It won't run from the shortcut.

Zak said...

This only works if you are a local administrator on the computer. Is there no way to configure an application to run elevated for a standard user?