Batch file that require elevation (UAC)


Recommended Posts

I have two batch files that I run via task scheduler on my CCTV system, and they both require elevation from UAC. I have a series of commands that I got from another source awhile ago to call for UAC, however, I need this option to be able to run without my input. Is there any method for calling for these commands that require admin rights that doesn't require my input?

  On 01/10/2022 at 14:08, Shane Farmer said:

Run as Admin in Task Scheduler, or any user, really.  It saves the credentials.  There is an option for highest privileges.  The are really multiple ways to do it.  What are they doing?  Can you share them? 

 

Can you run them as system? 

Expand  

The first one calls a program: DeleteFilesOlderThan /p="C:\Program Files\Agent\Media\WebServerRoot\Media\video" /s=1 /t=1m

The second one is simply  del  /s *.jpg C:\Program Files\Agent\Media\WebServerRoot\Media\video"  but for some reason they both need UAC permissions to run

I just double checked, and both the tasks are set to run with highest privileges, yet they both request UAC when running. The first task only runs on the 1st of each month, the second one runs every morning

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.