Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

FAQ: What is the UAC? - Part2

- - - - -

  • Please log in to reply
56 replies to this topic

#1
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

Hi, this is my second part of the series "What is the UAC".

People always disable the UAC because there is no way to disable the UAC for a specific program. is this really true?
No, it is not true. There is an build in way to do this!

Q: How can I do this?
A: Use the taskscheduler.

1. Start the computer management MMC snap-in

Attached File  00_Start_ComputerManagement.png   23.39KB   466 downloads

2. This step is optional: go to Task scheduler Library and make a right click and click "New Folder" (see picture 2)
and type in "myTasks" to create a new folder (see picute 3)

Attached File  01_TaskScheduler_NewFolder.png   29.99KB   288 downloads
Attached File  02_TaskScheduler_NewFolder_1.png   23.46KB   212 downloads

3. Make a right click on the folder myTasks and select "Create Task"

Attached File  03_TaskScheduler_CreateTask.png   16.15KB   225 downloads

and type in a name: I always name them "autoElevatePROGRAMNAME". Here for my expample "autoElevateProcessExplorer" and mark the checkbox "Run with highest priviligies".

Attached File  04_TaskScheduler_CreateTask_Config.png   24.53KB   386 downloads

4. go to the tab "Actions" and select the program you want to execute

Attached File  05_TaskScheduler_Action.png   24.38KB   364 downloads

and click ok, to create the Task.

5. create a new shortcut on your desktop and type in the following command:

C:\Windows\System32\schtasks.exe /RUN /TN "myTasks\autoElevateProcessExplorer"

Q: Do I have to do this for all programs I want to start?
A: Yes

Q: How Do I backup my tasks?
A: make a right click on the task and select "Export" and save it into a XML file and after a reinstall of your Windows
Vista / 7 select "Import Task" and import the XML file again.
Q: How do I start applications with administrator rights at startup?
A: You can copy the shortcut into the startup folder ( C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup ) or run the task with a trigger (in the task creation window to to "triggers" and select "create Trigger" and choose "Begin the task" - "At logon". If you create such an trigger you don't have to put the shortcut into the startup folder.

So I hope I was able to show you how to start applications with elevated rights, without disabling the UAC and without being "annoyed" to accept the UAC prompt. I'm using this technique for 3 years (starting with Vista Beta2 Milestone Builds) now.
Posted Image


How to remove advertisement from MSFN

#2
Tedology

Tedology
  • Member
  • 2 posts
I appreciate your efforts to help us out. :)

I've tried your instructions, and yet still when I double-click the shortcut, the UAC prompt still appears. I have even tried right-clicking the shortcut and choose "Run as Administrator" and it still is prompting. :(

#3
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

Hi,

don't choose "Run as Administrator"! Have you selected the checkbox "Run with highest priviligies"?

André
Posted Image

#4
Tedology

Tedology
  • Member
  • 2 posts

Hi,

don't choose "Run as Administrator"! Have you selected the checkbox "Run with highest priviligies"?

André


Aha! I must not have checked that box. Thanks so much, Andre! (sorry, don't know how to make the accent over the 'e' on a PC) :)

#5
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

Ok, great that it works now :)
Posted Image

#6
Bonusforum.se

Bonusforum.se
  • Member
  • 1 posts

Hi, this is my second part of the series "What is the UAC".

People always disable the UAC because there is no way to disable the UAC for a specific program. is this really true?
No, it is not true. There is an build in way to do this!

Q: How can I do this?
A: Use the taskscheduler.

1. Start the computer management MMC snap-in

Attached File  00_Start_ComputerManagement.png   23.39KB   466 downloads

2. This step is optional: go to Task scheduler Library and make a right click and click "New Folder" (see picture 2)
and type in "myTasks" to create a new folder (see picute 3)

Attached File  01_TaskScheduler_NewFolder.png   29.99KB   288 downloads
Attached File  02_TaskScheduler_NewFolder_1.png   23.46KB   212 downloads

3. Make a right click on the folder myTasks and select "Create Task"

Attached File  03_TaskScheduler_CreateTask.png   16.15KB   225 downloads

and type in a name: I always name them "autoElevatePROGRAMNAME". Here for my expample "autoElevateProcessExplorer" and mark the checkbox "Run with highest priviligies".

Attached File  04_TaskScheduler_CreateTask_Config.png   24.53KB   386 downloads

4. go to the tab "Actions" and select the program you want to execute

Attached File  05_TaskScheduler_Action.png   24.38KB   364 downloads

and click ok, to create the Task.

5. create a new shortcut on your desktop and type in the following command:

C:\Windows\System32\schtasks.exe /RUN /TN "myTasks\autoElevateProcessExplorer"

Q: Do I have to do this for all programs I want to start?
A: Yes

Q: How Do I backup my tasks?
A: make a right click on the task and select "Export" and save it into a XML file and after a reinstall of your Windows
Vista / 7 select "Import Task" and import the XML file again.
Q: How do I start applications with administrator rights at startup?
A: You can copy the shortcut into the startup folder ( C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup ) or run the task with a trigger (in the task creation window to to "triggers" and select "create Trigger" and choose "Begin the task" - "At logon". If you create such an trigger you don't have to put the shortcut into the startup folder.

So I hope I was able to show you how to start applications with elevated rights, without disabling the UAC and without being "annoyed" to accept the UAC prompt. I'm using this technique for 3 years (starting with Vista Beta2 Milestone Builds) now.


This doesnt work for me (or shall I restart windows or something?)
I have added the tasks and created the shortcut and run it but still it still says "Do you want to open this program" :S?

Or do you mean that we always should use this shortcut when we want to open (not the orginal exe-file?)

#7
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

yes, always run the shortcut!
Posted Image

#8
CompletelyLost

CompletelyLost
  • Member
  • 1 posts
  • OS:Windows 7 x64
  • Country: Country Flag
I followed your instructions and applies it to Windows 7, Everything worked out fine. And then, when I tried to make a short cut, the command line was incorrect. With a little inventigation, I discovered window 7 uses "tasksch" instead "schtask" as used in step 5. However, changing that part of the line didn't work either. So, a little more investigation, i found this "%Windir% preceeding the command for task scheduler. Can you look into Step 5 for Windows 7? I like to use this for my other programs.

#9
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

Hi,

my guide works under Windows 7! Windows 7 still uses the schtask.exe and nothing else.

Post your steps and post which program you're trying to start and which error did you see!

André
Posted Image

#10
drosalion

drosalion
  • Member
  • 1 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Thanks alot for this, been searching the web for a solution to this frustrating problem - yours worked perfectly, thanks.

#11
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Hi Andre,

I think that this is what I've been looking for. I am "in conversion" from XP PRO to Windows 7 (dual boot at the moment) and have a small utility that I'd like to run in Win 7 (Home Premium). It runs in XP PRO SP3 compatibility mode and is called Crystal Internet Meter. It will start manually but requires the UAC OK. I tried your technique here to try to get it to start automatically at start up (which it does in XP PRO) without the UAC message. But every time I try to run the short cut I get a message saying that the utility is already running. But it's not - I've checked the task manager and it is definitely not running.

Any suggestions will be welcomed.

Thank you in anticipation.

#12
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

uncheck all compatibility options.

Please also export the task as a xml file and post it here.
Posted Image

#13
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Thank you for getting back to me on this. I checked and all compatibility options are off.

Here's the XML...


<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.micro...4/02/mit/task">
<RegistrationInfo>
<Date>2010-06-26T21:15:12.2936476</Date>
<Author>Win7-PC\Win7</Author>
<Description>To Auto-Start Crystal Internet Meter</Description>
</RegistrationInfo>
<Triggers />
<Principals>
<Principal id="Author">
<UserId>Win7-PC\Win7</UserId>
<LogonType>Password</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>P3D</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"C:\Program Files\Crystal Internet Meter\cimeter.exe"</Command>
</Exec>
</Actions>
</Task>

#14
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

Hi,

change the logon type to:

<LogonType>InteractiveToken</LogonType> (only run when the user is logged on)

Your configuration will run the task in session 0 (the services session and you can't see the UI)
Posted Image

#15
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag
Hi Andre,

Thanks for getting back to me. I edited the XML, deleted the current task and tried to import the edited XML but got an error. What paremeter should I set to get the "InteractiveToken" when I rebuild the task from scratch. Also, the utility runs a small window showing the trafiic going up and down the (ADSL) line, so I definitely want to see that window - does your statement "you can't see the UI" imply that I would not be able to see the traffic window?

Thanks again for your help.

#16
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

Edit the task inside the Task scheduler and select "Run only when user is logged on"
Posted Image

#17
riod

riod
  • Member
  • 1 posts
  • OS:Windows 7 x64
  • Country: Country Flag
Hi Andre, here's is my issue:
I'm trying to run that program in a user account, is there a way to work around the admin password that pops up every time or does the scheduler just doesn't care about the fact that an admin created the task? and I will never be able to run that program in the user's account unless I give that person the admin password :s

#18
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

and I will never be able to run that program in the user's account unless I give that person the admin password :s


this workaround only works for accounts who are inside the administrator group.
Posted Image

#19
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag

Edit the task inside the Task scheduler and select "Run only when user is logged on"

Hi Andre, great! It will start OK now without the UAC message - thanks. Now, how can I get it to auto-start when I start up the computer? I tried pinning the shortcut to the start menu but it does not start. Thanks again in anticipation.

#20
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

copy the shortcut the the following folder:

C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Posted Image

#21
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag

copy the shortcut the the following folder:

C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup


Fantastic!!!! I still get the fleeting message in a window that is hard to read just before the app starts, but start it does, and seems to run just fine. Many many thanks for your advice - much appreciated:-)

A friend suggested using Camstudio2.0 to record what was happening on the screen and it captured the elusive message which says "SUCCESS: Attempted to run the scheduled task" followed by the task name. Is there a way to suppress this message - i.e., stop it from appearing? Thanks again.

Edited by Necuima1, 04 July 2010 - 06:50 PM.


#22
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag
As per the message above...

A friend suggested using Camstudio2.0 to record what was happening on the screen and it captured the elusive message which says "SUCCESS: Attempted to run the scheduled task" followed by the task name. Is there a way to suppress this message - i.e., stop it from appearing?

Thanks in anticipation.

#23
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

you mean the cmd window? Open the properties of the shortcut and select "start minimized".
Posted Image

#24
Necuima1

Necuima1
  • Member
  • 7 posts
  • OS:Windows 7 x86
  • Country: Country Flag

you mean the cmd window? Open the properties of the shortcut and select "start minimized".


Ahhh - yes, that fixed it - many thanks again!!

#25
MagicAndre1981

MagicAndre1981

    after Windows 7 GA still Vista lover :)

  • Patrons
  • 5,990 posts
  • OS:Vista Ultimate x86
  • Country: Country Flag

Donator

You're welcome :)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN