- Microsoft Windows 7 Enterprise
- User with Local Administrator Privileges (required for setup)
Why?
Our work has group policies and two of our programs, Visual Studio 2010 Ultimate (VS2010) and Business Intelligence Development Studio (BIDS), require elevated or administator rights/privileges when run. This is so that these programs can write back and forth to our C drive. If we don't run them as local administrators on the workstation, they error incessantly and never manage to do what you want them to do.
What?
I want to create a desktop shortcut that I can double-click and it will run the above programs in administrator mode without confirmation by the Windows operating system. At home this may not be a problem but this is intended for those in an office environment and we get prompted to login (with the same account as we're currently logged-in with???) instead of being able to just click on "Yes".
How?
The gist is that we're going to create a scheduled task (that won't be scheduled) and a shortcut to that task:
- Open the Task Scheduler (Start > Run... > Type taskschd.msc > OK) - You will need administrator rights for this step.
- Click on Create Task...
- Under the General tab,
- for "Name" give it a general name with no symbols/special characters and preferably no spaces (I tend to give it an all lowercase name with no spaces).
- tick the checkbox Run with highest privileges.
- set "Configure For" to Windows 7, Windows Server 2008 R2
- Under the Actions tab,
- Click on New...
- Leave "Action" as Start a program
- for Program/Script, Specify the command path which is usually %windir%\System32\cmd.exe
- Add arguments in format /c start "Task Name" "Full Path of Program", for example:
- for Start In..., I leave this blank but you could specify a working directory.
- OK the dialogs and close the Task Scheduler
- Right-click on an empty space on the desktop and select New > Shortcut
- Type in the task with the format schtasks /run /tn "task-name" and click on Next
- Give the shortcut a name to display as (eg. "Visual Studio 2010")
- Click on OK to complete your shortcut.
Related Link(s):
- Elevated Program Shortcut without UAC Prompt
- Avoid UAC prompts by using an elevated program launcher
- StackOverflow: Need to elevate permissions without UAC pop ups
- How to Run Programs Elevated Without Getting the UAC Prompt
- Vista setuid – How to elevate without prompting
Further Notes
Location of Windows 7 Taskbar shortcuts (Pinned): %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar. You can determine what %APPDATA% is by opening a command prompt and typing: