Windows 7 Grant Admin Privileges To Batch File - Solved

Cardinal System

Honorable Member
I have a batch file that runs on logon as a task, but it does not work on non-admin desktops because it uses admin level commands. I want it to run as administrator without prompting the user for a password. I tried going into the file properties, clicking compatibility, and checking "Run This Program As An Administrator", but the check box was grayed out and couldn't be checked.

What can I do?
 
Your best option would be to create a scheduled task
  • Open Task Scheduler
  • I typically create a folder for my non-Microsoft tasks. I just called it "My Tasks"
  • Select the folder and right click in the center pane and select "Create a new task"
  • Under the general tab give it a name and under the security section change the user it runs as to SYSTEM
  • "Run whether a user is logged on or not will auto select and run with highest privileges and Hidden
  • Go to the trigger tab and set the trigger to be "At log on" and details to "At log on of any user"
  • Under Actions tab select "start a program" and select your batch file
  • Conditions tab is optional settings, I usually uncheck all the power settings but it's up to you
  • Settings tab is some optional stuff for if the program fails etc.
  • Reboot and test
 
Your best option would be to create a scheduled task
  • Open Task Scheduler
  • I typically create a folder for my non-Microsoft tasks. I just called it "My Tasks"
  • Select the folder and right click in the center pane and select "Create a new task"
  • Under the general tab give it a name and under the security section change the user it runs as to SYSTEM
  • "Run whether a user is logged on or not will auto select and run with highest privileges and Hidden
  • Go to the trigger tab and set the trigger to be "At log on" and details to "At log on of any user"
  • Under Actions tab select "start a program" and select your batch file
  • Conditions tab is optional settings, I usually uncheck all the power settings but it's up to you
  • Settings tab is some optional stuff for if the program fails etc.
  • Reboot and test
There were no options to run as SYSTEM. I also wanted it to run for all users, but the check box for that was grayed out. Then I ran task scheduler as administrator, and everything I needed showed up, including the SYSTEM option. Thank you for your help! Ignore the screenshot, it was an accident.
 

Attachments

  • Capture.PNG
    Capture.PNG
    275.5 KB · Views: 374
Last edited:
Back
Top