Start program WITHOUT UAC, useful at system start and in batch files (use task scheduler)

I like to run the search program Everything (link valid 6/4/2014 but check techsupportalert.com for any updates) but it is a stand-alone executable downloaded from the internet so it triggers a UAC (User Account Control) warning.

No biggie, but i also want it to start automatically when windows starts. And i dont want to have to click UAC or have my customers click UAC every time they start windows.

I also might want to put commands that must be elevated in batch jobs (.bat files) when there’s no one there to click YES to the UAC.

The workaround is to go thru task scheduler. There you can set up a task to start with elevated privileges which won’t trigger a UAC.

The article at http://www.winhelponline.com/blog/run-programs-elevated-without-getting-the-uac-prompt/ contains the basic, but forgets some points.

My edits are in green:

Creating a Scheduled Task

1. Open Task Scheduler by clicking the Windows Orb and typing “task” and selecting “Task Scheduler” from the search results, or from Control Panel or by running the command control schedtasks from Start, Search box.

2. Left-click Task Scheduler Library category in the left to select it (make it highlighted; or else you can’t do “New Folder” below)

3. Right-click “Task Scheduler Library” category in the left, and choose New Folder

4. Name the folder as MyApps (or whatever name you choose; you’ll use the same name again, below)

5. Click the little triangle to the left of “Task Scheduler Library” to display the list of folders beneath it, including our newly created MyApps folder.
Select the MyApps folder (or whatever you named it) by left clicking on it once.

6. In the Actions pane on the right, click Create Task…

7. Type a name for the task that you want to create. You’re going to have to type this again later, so for convenience, keep it short and dont use any spaces.

8. Enable the option Run with highest privileges. This is an important step. In fact the key to the whole thing.

8.a. (FYI The “Hidden” checkbox refers to only viewing tasks in the task scheduler; there is way to show or now show hidden tasks when in task scheduler; This Hidden settings does not make the task hidden in any way when it runs.)

9. Select the Action tab

10. Click New

11. Click Browse… to select the program (Example: Regedit.exe) you want to run, and mention the parameters (called arguments in task scheduler). required if any, for the application. (For example, to run a .REG file, select Regedit.exe and mention the parameter (argument) as “/s filename.reg” without the quotes. Another example: my Everything program takes a -startup argument to start in the system tray rather than with a window.)

To run Services MMC applet, browse and select MMC.EXE and type services.msc in the Add arguments (optional) field.

12. Select the Conditions tab

12.a. UNcheck “Start the task only if the computer is on AC power”

13. Select the Settings tab

13.a UNcheck “Stop the task if it runs longer than”

13.b at the bottom there is “If the task is already running, then the following rule applies:” You can choose whatever you want here.

If when it’s running you want to not start another one, select “Do not start a new instance”.

If when it’s running you want might want start another one running simultaneously, select “Run a new instance in parallel”.

If when it’s running you want to end the one that’s currently running, and start another one running, select “Stop the existing instance”.

I suppose “Queue a new instance” is helpful, but i can’t think of an example right now.

Note, you can export this to an xml file (see below) and then import it into another system

Creating a Scheduled Task via cmd line schtasks

(NOTE: this method is NOT AS GOOD–see below)

Alternatively, you can create a task via the cmd line schtasks :

schtasks /create /sc once /tn cmd_elev /tr cmd /rl highest /st 00:00
schtasks
invoke the schtasks.exe cmd line program
/create
schtasks can also query, delete, etc; we want to create a task
/sc once
how often to run; we’re not creating a repetitive task; in fact we dont want to run it at all, just set it up to be run manually, but that option does not appear to be available, so “once” is the closest (see explanation at /sc starttime)
/tn cmd_elev
/tn stands for Task Name and you can name it anything you want (but you have to use the same name when you later invoke /run
/tr cmd
the command to run, in this case the cmd.exe program, aka command prompt
/rl highest
Why we came to the party. /rl stands for Run at privilege Level; and we want the highest priv level

/st 00:00
/st stands for Start Time; dont want a start time, but it appears to require one. When you create thru the GUI you dont have to have a trigger at all, but via cmd line you seem to (or was it just me?). I just put in 00:00 (format is HH:MM) which is never in the future, which means it’ll trigger a warning

WARNING: Task may not run because /ST is earlier than current time.

Yeah, that’s what i want. (NOTE: love those microsoft guys: it’s a nit, but when the time is EQUAL to the current time, you get the warning)

If all goes well, you should see

SUCCESS: The scheduled task "cmd_elev" has successfully been created.

or whatever name you called it.

If you re-run the line (let’s say you were experimenting 😉 you will get the warning

WARNING: The task name "cmd_elev" already exists. Do you want to replace it (Y/N)? y

You can safely say Y to this.

NOTE: this method is NOT AS GOOD as creating thru the GUI. At least i could not find the switches to set some important things.

Namely,

  • “start the task only if the computer is on ac power” will be checked in the conditions tab; not ideal
  • “stop the task if it runs longer than [time]” where time defaults to “3 days” will be checked in the setting tab; not ideal

Launching a Scheduled Task item manually

To run a scheduled task item manually, use the schtasks.exe command-line tool that comes with Windows. For example, to launch the Services console task that you already created, use the following command:

SCHTASKS.EXE /RUN /TN MyApps\REGEDIT

Note: Where MyApps\REGEDIT is the name you chose for the folder and Taskname. You’ll need to enclose the task name within double-quotes if the task name contains blank spaces in between. (Example: SCHTASKS.EXE /RUN /TN folder\“Name of the Task”) If the folder has spaces, you’ll have to enclose that in double-quotes; perhaps best to enclose the whole thing. (Example: SCHTASKS.EXE /RUN /TN “folder\Name of the Task”)

Creating Shortcuts to run each Task

You can create a Desktop shortcut for each scheduled task item you’ve created earlier. Right-click on the Desktop and choose New, Shortcut. Type the command-line (say, SCHTASKS.EXE /RUN /TN MyApps\REGEDIT). Mention a name for the shortcut and click Finish.

Run the task minimized

As Schtasks.exe is a console utility, you’ll see the Command Prompt window opening and closing quickly whenever you run the shortcut. So, you may configure the shortcut to run in a minimized window state, in the the shortcut properties.

  • Right-click on the shortcut and click Properties.
  • In the Run drop-down options, change the selection from “Normal Window” to Minimized.
  • Click OK.

Note: In the shortcut properties, you may want to click Change Icon and assign appropriate icon for the shortcut. The icons should be present inside the executable itself, in most cases. For Regedit.exe, browse to Regedit.exe and choose an icon. You may also browse the shell32.dll and imageres.dll files for additional icons.

xml file

Once you set up a task the way you like it via the GUI (recommended method), you can export it to an xml file so that it’s easier to set up on the next system.

Here’s my xml file for (Search) Everything. Filename ends in .xml.txt so change it to just .xml befor importing to task scheduler. start_search_everything.xml.txt

Other Methods

There are at least three other compelling methods.

The first two come from

1. NirSoft NirCmd

nircmdc has an elevate cmd

nircmdc elevate cmd

2. SysInternals PsExec

Part of PsTools suite.

psexec.exe -accepteula -h -u “$username” -p “$password” cmd.exe

The “-h” switch is the one doing the magic:

-h If the target system is Vista or higher, has the process run with the account’s elevated token, if available.

The third comes from

3. vbs or PowerShell to elevate

key lines are to use the visual basic script / vbscript command UAC.ShellExecute to perform the elevation, create a new cmd (command prompt), and re-run the original bat file, now elevated. Does that by writing a .vbs file:

ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"

Or, you can use PowerShell to elevate:

if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( powershell "saps -filepath %0 -verb runas" >nul 2>&1)

Elevated command prompt and mapped drives

One problem you might encounter when using this method if you’re running a batch file (.bat) in elevated mode, is: Mapped drives (incl net use) missing from elevated processes eg UAC cmd run as administrator. Fortunately, there’s some solutions in that blog post.

Microsoft Office Purchase Options

Product Key Card (PKC) can only be installed on 1 computer. If you buy a new computer, you need to buy a new Product Key Card.

  • Retail versions can be installed on a new PC.
  • ( Retail Packaged Price ) / ( Product Key Price ) > ( 1 + Chance you’ll need to upgrade your PC) ==>> buy PKC
  • ( Retail Packaged Price ) / ( Product Key Price ) < ( 1 + Chance you’ll need to upgrade your PC) ==>> buy Retail
  • See More Below

Microsoft Office 2013 is optimized for Windows 8 and the Metro interface.

Microsoft Office 2010 and higher (NOT 2007) has 64bit version so doesnt need to run in 32-bit emulation in win 7 64bit

Microsoft Office 2007 was the first with the ribbon.

Microsoft Office 2007 was the first with .docx (open xml).

2007: basic home & student standard small busi pro pro plus
2010: personal home & student home & business standard pro pro plus
Outlook: [no ppt] no yes yes yes yes

Product Verson Price Vendor
Standard / Business
Microsoft Office Home & Business 2013 – Product Key, 32/64-Bit, – T5D-01575 Item#: M17-3298 2013 Busi $219.99 TigerDirect
Microsoft Office Home and Business 2013 Product Key Card – 1 PC
Model #: T5D-01575
Item #: N82E16832416580
2013 Busi key $189.99 newegg
Microsoft Office Home and Business 2010 Product Key Card
Model#: MSH&B2011 15413 upc: 0079936684545
2010 Busi Key In stores only ($199.99) walmart
Office 2010 Home and Business License Product Key Card (PKC) 1 PC
SKU: 1308085362
2010 Busi Key $248 BestBuy –
IT Wholesalers
MS Microsoft Office 2007 Standard Full Retail English Version =BRAND NEW BOX= 2007 Std media 5/31/2014: $199.95 Ended Ebay – soft_123
Microsoft Office Pro Professional 2007 MLK Full Version NEW & Sealed 2007 Pro Key 5/31/2014: $149.99 Ended Ebay – mygrummy
Microsoft Office 2010 Professional For 2 PCs Full Retail Version MS Pro 2010 Pro media 5/31/2014: $192.50 = $96.25 ea 39 bids 2.5d left Ebay – vaz_auctions
Microsoft Office 2010 Professional For 2 PCs Full Retail Version MS Pro 2010 Pro media 5/31/2014: $349.95 / 2 = $174.88 Ebay – vaz_auctions
Microsoft.Office.Professional.2010.Full version 2010 Pro Key 5/31/2014: $45.00 2/5 sold Ebay – hami_laur
Microsoft Office 2010 Professional Full Retail Version (64/32Bit) Brand New 2010 Pro media 5/31/2014: $99.77 26 bids 1d left
6/01/2014: $126.32 28 bids 7h left
Ebay – hugo_todd
Microsoft Office Professional 2010 Key Card 1PC/1User [Old Version] by Microsoft Software – PC 2010 Pro Key New = $314.01; Open Box = $242.00 Amazon
Microsoft Office Professional 2010 [Old Version] by Microsoft Corp. – PC 2010 Pro media New = $220.00; Open Box = $175.00(brand new user; warning) or $200 Amazon
Microsoft Office Standard 2007 [OLD VERSION] by Microsoft Software – PC 2007 std media Price = $191.99; New = $159.00; Open Box = $69.99 Amazon
Microsoft Office Small Business 2007 FULL VERSION [Old Version] by Microsoft Software – PC 2007 sm busi media Price = $258.68; New = $200.00; Open Box = $162.99 Amazon
Student
Microsoft Office Home & Student 2013 – Product Key, 32/64-Bit – 79G-03550 Item#: M17-3300 [no Outlook] 2013 Stud $139.99 TigerDirect
Office 2010 Home and Student Product Key Card (no media) Model #: 79G-02020 Item #: N82E16832116861 2010 Stud $99.99 newegg
Microsoft Office 2010 Home & Student 3-User
Model #: 79G-02144
Item #: N82E16832116856
2010 Stud 3-user $289.99 ($96.66 / user) newegg
Microsoft Office Home and Student 2013 Product Key Card – 1 PC
Model #: 79G-03550
Item #: N82E16832416581
2013 Stud key $119.99 newegg
Microsoft Office Home and Student 2010 (1 PC – Product Key Card)
Model#: 79G-02020
2010 Stud Key $119.44 walmart
MS Microsoft Office Home & Student 2010 Family Pack For 3PCs x3 =Factory Sealed= 2010 Stud 3-user 5/31/3014: $122.50 = $40.83 /user 23 bids 4.5d left Ebay – shykaliguy


Product Key Card (PKC) can only be installed on 1 computer. If you buy a new computer, you need to buy a new Product Key Card.

  • Retail versions can be installed on a new PC.
  • PKC needs to be ~25% cheaper (~75% the cost) to be worth it if there is, say 50% risk of buying a new PC.
  • ( Retail Packaged Price ) = ( Product Key Price ) * ( 1 + Chance you’ll need to upgrade your PC)
  • ( Retail Packaged Price ) / ( Product Key Price ) = ( 1 + Chance you’ll need to upgrade your PC)
  • ( Retail Packaged Price ) / ( Product Key Price ) > ( 1 + Chance you’ll need to upgrade your PC) ==>> buy PKC
  • ( Retail Packaged Price ) / ( Product Key Price ) < ( 1 + Chance you’ll need to upgrade your PC) ==>> buy Retail
  • Eg:
    • Retail = $200
    • PKC Price = $150
    • Chance upgrade = 50%
    • 200 / 150 ?? 1 + .5 ==>> 1.3 < 1.5 ==>> buy Retail
  • Eg:
    • Retail = $200
    • PKC Price = $100
    • Chance upgrade = 75%
    • 200 / 100 ?? 1 + .75 ==>> 2 > 1.75 buy PKC
  • Eg:
    • Retail = $200
    • PKC Price = $175
    • Chance upgrade = 10%
    • 200 / 175 ?? 1 + .10 ==>> 1.14 > 1.1 buy PKC
  • Eg:
    • Retail = $200
    • PKC Price = $185
    • Chance upgrade = 10%
    • 200 / 185 ?? 1 + .10 ==>> 1.08 < 1.1 buy Retail