New Fun Blog – Scott Bilas

Take what you want, and leave the rest (just like your salad bar).

How To Run Startup Admin Tasks In Vista

with 2 comments

[This is a quickie so I don’t forget how to do it.]

Startup + UAC = PITA

In Vista, if you have UAC enabled (*), any apps set to run on startup that require admin access will not run. Instead, they will go into a little tray icon, and you’ll get a bubble telling you to right-click and enable them. One at a time, with a UAC to confirm each.

I have four apps that require admin that I want to start every time I log in – Exposé clone Switcher, hotkeyed window sizer WinSplit Revolution, battery status monitor BattStat, and Vista’s Performance and Reliability Monitor (perfmon.msc). Well the first two don’t technically require admin to work, but I do want them to work on all my windows, not just the non-admin ones.

So anyway, every time I log in, I have to right-click on the tray, select one of these apps, then say run it, then get the UAC, then confirm it. There’s even a fun bug in Explorer where if you start to enable the second in the list before the UAC for the first has come up, then Explorer crashes. And then it’s forgotten what’s left due to the crash, so you can’t enable the rest. Have to log out and back in again (or manually launch them) to repair this.

I get to do that every time I log in. Well, that’s an annoying way to do it, Microsoft.

[I’m sure Windows 7 improves this situation, but at the minimum why isn’t there a “enable all” option that lets you use a single UAC to confirm them all at once, and then run them?]

(*) Yes, I use UAC. Why? Future post.

Startup + Task Scheduler = Success!

Vista’s new Task Scheduler is a good workaround for this problem. I learned about this from a great tool I use called Dexpot. I never liked virtual desktop apps until this one, and now I use it constantly. Love it! Anyway it has the ability to move all my windows, admin or not. And I didn’t remember seeing it do a UAC when I logged in to run.. What’s up? Turns out it had installed itself into Task Scheduler.

So here’s how to do it. Setup:

  1. Load Task Scheduler. Look, a UAC dialog!
  2. Right-click on the Task Scheduler Library folder and create a new folder.
  3. Name it something like “Autostart”. This is where to group all the startup stuff.

For each task you want to add, do the following:

  1. Right-click in the report pane and select Create New Task.
  2. Give it a name and description if you want.
  3. Check the box for “Run with highest privileges”.
    • This is the key option that makes this whole thing work for us.
  4. On the Triggers tab, add a trigger for when your username logs in. Select “At log on” for “Begin the task”.
    • If you want to have a delay on running your task, you can check the “Delay task for” box in the advanced configuration section and select a time.
    • By the way, don’t believe the limited options in the drop-down. You can actually type in any number of seconds or minutes that you like.
  5. On the Actions tab, add a “Start a program” action to launch your app.
    • Put quotes around the fully qualified path to make sure it works right.
    • Note that you can’t put multiple actions in here, say on action to launch each app. These get serialized, so it will only launch the next one after the first process has exited. You need to create a separate task per app.
    • On the Settings tab, turn off the “Stop the task” setting. Otherwise Windows will kill your task after a few days!
    • Hit Accept.

    Next time you log in, these apps will run with admin privileges and you won’t get a UAC prompt!

    April 26th, 2009 at 4:20 pm

    Posted in admin, uac, vista

    2 Responses to 'How To Run Startup Admin Tasks In Vista'

    Subscribe to comments with RSS or TrackBack to 'How To Run Startup Admin Tasks In Vista'.

    1. I’ve ran into this too, but my way around it was to just make a local system policy startup script. It runs in the context of system with admin rights and does not pop up uac dialogs.

      Aaron Bockelie

      6 May 09 at 10:43 pm

    2. Scripts are pretty old school way to do this, but it figures an IT guy would choose to do it that way. :)

      With Task Scheduler you get a lot more options about how to control how the tasks run. When one crashes it’s easy to right-click it in the scheduler and say to run it again. Also, you get a nice history.

      Scott

      7 May 09 at 12:38 pm

    Leave a Reply

    Note: This post is over 2 years old. Time moves fast on the internet and this article may be total bunk now! You may want to check later in this blog to see if there is any new information relevant to your comment.

    Want to paste some code into your comment? Just wrap it in [code] [/code]. Also, please note that off-topic or overly commercial comments will likely be removed at my discretion.

    Switch to our mobile site