-3

I'm working on a little time saving project for an installation of a software program and i'm having some real difficulties finding anything helpful.

What i'm trying to do is programmatically create and implement the common UAC workaround for executable's.

Where i'm at right is:

  • The executable automatically forces the user to run it as an administrator. Giving "complete" access (ie no "access denied" errors).

  • I programmatically create a "Scheduled Task" for an executable with no triggers that is set to run an executable with highest privelages.

The next step is to create a shortcut icon for this scheduled task (and ultimately populate it into the startup folder). This is where i'm having trouble.

I cannot, for the life of me, figure out how to create an icon that executes a scheduled task.

What i'm trying to do is here:

http://www.techsupportalert.com/content/how-create-program-shortcut-run-without-uac-prompt-windows-7.htm

It's the 7 steps following the first 12 steps.

The things i've thought of and could not figure out / find any information on are:

  • Programmatically running cmd command that will do this.
  • Locating executable for scheduled task and setting that as a shortcuts path (apparently there are no executable's for scheduled tasks).

I appreciate any help or thoughts on this. I've tried and can't really find anything on this for help.

user2338408
  • 182
  • 1
  • 11
  • I don't understand what you need: [this maybe](http://stackoverflow.com/questions/4897655/create-shortcut-on-desktop-c-sharp) – rene Aug 06 '15 at 21:07
  • What i'm trying to do is what's listed in [this link](http://www.techsupportalert.com/content/how-create-program-shortcut-run-without-uac-prompt-windows-7.htm). It's a shortcut that runs as an executable for a scheduled task. You can do this on most windows computers by hand by: 1) Right-click the desktop 2) Select New->Shortcut 3) When asked for the location of your program, type "schtasks /run /tn [TASKNAME]". I'm trying to do this programmatically. – user2338408 Aug 06 '15 at 21:33
  • circumventing mechanisms designed to keep a user safe is deplorable. – Sam Axe Aug 06 '15 at 23:14
  • Posting your opinion to a question without any knowledge of the context is deplorable. – user2338408 Aug 07 '15 at 00:42

1 Answers1

0
schtasks /run /tn TaskName

But you need to be an administrator.

There is no way around this. Security that can be avoided is not security.

bill
  • 215
  • 1
  • 3
  • 1
    Ended up creating a batch file with that command and stuffing it in the user specific startup folder. Works like a charm. – user2338408 Aug 07 '15 at 00:46