Batch Script to Run as Administrator

后端 未结 12 2076
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 11:18

I\'m writing a client/server checking program but it needs to run as Administrator.

I want this to run silently on my network and users, and I don\'t want the \"Run

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 11:39

    You have a couple options.

    1. If you need to do it using only a batch file and native commands, check out How can I auto-elevate my batch file, so that it requests from UAC admin rights if required?.

    2. If 3rd-party utilities are an option, you can use a tool like Elevate. It is an executable that you call with the program you want to run elevated as a parameter.
      Like this: elevate net share ....

提交回复
热议问题