Using python to open cmd and automatically enter a password

前端 未结 3 1032
慢半拍i
慢半拍i 2020-12-02 02:52

I\'ve managed to get the cmd being opened by python. However, using runas administrator comes with a password check before cmd.exe is executed.

I\'m using this to op

3条回答
  •  遥遥无期
    2020-12-02 03:26

    Although not an answer to your question, this can be a solution to your problem. Use psexec instead of runas. You can run it like this:

    psexec -u user -p password cmd
    

    (or run it from Python using subprocess.Popen or something else)

提交回复
热议问题