Grant Admin Privileges To Batch File - Solved

Discussion in 'Windows 7 Help and Support' started by bignose956, Sep 13, 2016.

  1. bignose956

    bignose956 Member

    Joined:
    Jan 24, 2016
    Messages:
    42
    Likes Received:
    0
    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?
     
  2. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,408
    Likes Received:
    362
    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
     
    BIGBEARJEDI and bignose956 like this.
  3. bignose956

    bignose956 Member

    Joined:
    Jan 24, 2016
    Messages:
    42
    Likes Received:
    0
    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.
     

    Attached Files:

    #3 bignose956, Sep 14, 2016
    Last edited: Sep 14, 2016
  4. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,408
    Likes Received:
    362
    Just type SYSTEM
     

Share This Page

Loading...