How do I make my program run with different privileges at Windows 7 startup?

Posted by iira on Stack Overflow See other posts from Stack Overflow or by iira
Published on 2010-05-04T09:43:02Z Indexed on 2010/05/04 12:38 UTC
Read the original article Hit count: 267

Hi, I am trying to add my program run in Windows 7 startup, but it doesn't work. My program has an embedded UAC manifest.

My current way is by adding a string value at HKCU..\Run.

I found a manual solution for Vista from http://social.technet.microsoft.com/Forums/en/w7itprosecurity/thread/81c3c1f2-0169-493a-8f87-d300ea708ecf

  1. Click Start, right click on Computer and choose “Manage”.
  2. Click “Task Scheduler” on the left panel.
  3. Click “Create Task” on the right panel.
  4. Type a name for the task.
  5. Check “Run with highest privileges”.
  6. Click Actions tab.
  7. Click “New…”.
  8. Browse to the program in the “Program/script” box. Click OK.
  9. On desktop, right click, choose New and click “Shortcut”.
  10. In the box type: schtasks.exe /run /tn TaskName where TaskName is the name of task you put in on the basics tab and click next.
  11. Type a name for the shortcut and click Finish.

Additionally, you need to run the saved scheduled task shortcut to run the program instead of running the application shortcut to ignore the IAC prompt. When startup the system will run the program via the original shortcut. Therefore you need to change the location to run the saved task. Please:

  1. Open Regedit.
  2. Find the entry of the startup item in Registry. It will be stored in one of the following branches.
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    • HKEY_USERS.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run
    • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  3. Double-click on the correct key, change the path to the saved scheduled task you created.

Is there any free code to add item with privileges option in scheduled task? I haven't found the free one in torry.net.

Thanks a lot.

© Stack Overflow or respective owner

Related posts about delphi

Related posts about startup