📎 AI Summary:
The original poster struggles to run a batch file with administrator privileges at logon due to grayed-out options in property settings. The suggested solution is to create a scheduled task, run as SYSTEM, with specific trigger and action settings, which the original poster confirms works after running Task Scheduler as administrator. The overall sentiment is that using a scheduled task as SYSTEM is an effective workaround for running privileged scripts without prompts.

Cardinal System

Honorable Member
Member details
Joined
Jan 24, 2016
Messages
87
Thread Author #1
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?
 

Solution
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...

Neemobeer

Windows Forum Team
Staff member
Member details
Joined
Jul 4, 2015
Messages
8,995
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
 

Solution

Cardinal System

Honorable Member
Member details
Joined
Jan 24, 2016
Messages
87
Thread Author #3
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.webp
    Capture.webp
    62.7 KB · Views: 374
Last edited: