Running bat file at startup as administrator in Windows 7

I'm currently running a startup script in form of a bat file successfully in Windows 7 (I've inserted a new registry key entry with the bat file path as value in

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run).

Now I need to run another bat file at startup, but with elevated rights (as administrator), and without manually confirming a prompt.

How can I achieve this, preferrably without external programs?


Solution 1:

See this article : Make Vista launch UAC restricted programs at startup with Task Scheduler.

This article shows how to use the Task Scheduler to launch startup programs with elevated privileges. Some small changes may be required in your case, but the article is well-written with screenshots.

The answer Schedule a task with admin privileges without a user prompt in windows 7 is useful in this case; in particular "Run with highest privileges" is really important.

Solution 2:

Have you thought of a different approach? Either a pure group policy for the equivelent registry setting, else setting the batch file to run as a group policy. It maybe that you could even run it as a computer script, rather than a user script.

Start with gpedit.msc. However, it does need Ultimate or one of the other top end editions.