none
How to run batch file with"run as administrator"?

    Question

  • Hi:

     I am using window server 2008 R2,I scheduled a task as weekly and its a batch file ,I want to run it as administrator.what is the entire process,policies which I need to take care.

    Please assist,

    Thanks

    Sunil.


    • Edited by sunil tikar Thursday, February 06, 2014 4:15 PM
    Thursday, February 06, 2014 4:14 PM

Answers

  • When you create the task, there is a check box at the bottom of the window called "Run with highest privileges"

    That will initiate the task in an elevated mode and run your batch file appropriately.

    You may want to ensure the account used to run the process has the appropriate permissions to accomplish whatever it is your script is doing.


    - Chris Ream -

    **Remember, if you find a post that is helpful, or is the answer, please mark it appropriately.**


    Friday, February 07, 2014 4:23 AM
  • Hi Sunil,

    Please refer to the suggestion that Chris Ream provided and check if can help you to achieve target.

    In addition, you can also right click the batch file and select Create shortcut. Then right click the shortcut of this batch file and select Properties. In Properties dialog box, select Shortcut tab, click ‘Advanced…’ button. In Advanced Properties, check Run as administrator. Then when you create the schedule task, please set the shortcut of this batch file as action in the Actions tab. Please check if this can help you to get target.

    As Chris Ream says, please take care that assign appropriate permissions to account.

    Hope this helps.

    Best regards,

    Justin Gu

    Monday, February 10, 2014 8:23 AM

All replies

  • When you create the task, there is a check box at the bottom of the window called "Run with highest privileges"

    That will initiate the task in an elevated mode and run your batch file appropriately.

    You may want to ensure the account used to run the process has the appropriate permissions to accomplish whatever it is your script is doing.


    - Chris Ream -

    **Remember, if you find a post that is helpful, or is the answer, please mark it appropriately.**


    Friday, February 07, 2014 4:23 AM
  • Hi Sunil,

    Please refer to the suggestion that Chris Ream provided and check if can help you to achieve target.

    In addition, you can also right click the batch file and select Create shortcut. Then right click the shortcut of this batch file and select Properties. In Properties dialog box, select Shortcut tab, click ‘Advanced…’ button. In Advanced Properties, check Run as administrator. Then when you create the schedule task, please set the shortcut of this batch file as action in the Actions tab. Please check if this can help you to get target.

    As Chris Ream says, please take care that assign appropriate permissions to account.

    Hope this helps.

    Best regards,

    Justin Gu

    Monday, February 10, 2014 8:23 AM