# [SOLVED] About .bat files - Run As Administrator



## epshatto (Dec 23, 2010)

Hi all-

I've created a few batch files and set them to run as scheduled tasks.

My question is this: is there a way I can have the files run as an administrator? In other words, two of my files require the command prompt to be run as an admin. Is there some way I can set these to run as such _without_ having to click the "Yes" button when Windows prompts me (so it will run that way without me sitting here and providing the authentication), and also _without_ having to disable UAC?


----------



## Jonathan_King (Apr 3, 2010)

*Re: About .bat files*

There may be other ways, but here's one way I know. Create a shortcut to the .bat file, and then right-click on it and select Properties. In the Compatibility tab, select "Run as Administrator".

Then set the scheduled task to the shortcut.


----------



## epshatto (Dec 23, 2010)

*Re: About .bat files*

Interestingly enough, when I do that, the checkbox to run as an administrator remains grayed out.


----------



## jcgriff2 (Sep 30, 2007)

*Re: About .bat files*

See if checking the box "Run with highest privileges" in Task Scheduler bypasses UAC.

You may be able to select "System" as the user in Task Scheduler - Schedule a task

Regards. . .

jcgriff2

`


----------



## epshatto (Dec 23, 2010)

*Re: About .bat files*

jcgriff2 - that seemed to work, thank you. Looks like this is solved.


----------



## jcgriff2 (Sep 30, 2007)

*Re: About .bat files*

Thanks for posting back -- glad it worked.

Enjoy the rest of the weekend. . .

jcgriff2

`


----------

