How to create a batch file to run cmd as administrator

前端 未结 12 2192
一个人的身影
一个人的身影 2020-12-04 19:43

I need to run a batch file which needs to register a DLL. The DLL registration is failing because the Batch file is not starting the command prompt as \"administrator\".

12条回答
  •  [愿得一人]
    2020-12-04 20:22

    As user2549366 suggested before, "You can use a shortcut that links to the batch file." but in the Properties->Compatibility tab of the shortcut, run as administrator may be disabled.

    So instead You just right click on your "file.bat - shortcut" then go to ->Properties->Shortcut tab -> Advanced and there you can click Run as administrator. After that, You can execute the shortcut.

提交回复
热议问题