How to create a batch file to run cmd as administrator

前端 未结 12 2215
一个人的身影
一个人的身影 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:26

    Here's a more simple version of essentially the same file.

    @echo off
    break off
    title C:\Windows\system32\cmd.exe
    cls
    
    :cmd
    set /p cmd=C:\Enter Command:
    
    %cmd%
    echo.
    goto cmd
    

提交回复
热议问题