且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何创建一个批处理文件来运行CMD以管理员身份

更新时间:2022-02-12 09:54:31

您可能需要使用另一个批处理文件率先推出第二个拥有管理员权限。

You might have to use another batch file first to launch the second with admin rights.

在第一次使用

runas /noprofile /user:mymachine\administrator yourbatchfile.bat

在进一步阅读,你必须能够在提示符下键入密码。你不能管密码此功能已锁定出于安全原因。

Upon further reading, you must be able to type in the password at the prompt. You cannot pipe the password as this feature was locked down for security reasons.

您可能有更多的运气 PSEXEC