从Python将密码传递给runas [英] Pass Password to runas from Python

查看:244
本文介绍了从Python将密码传递给runas的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以其他用户身份运行文件,而无需从脚本中提示输入密码.怎么做?

I need to run a file as another user without it prompting for a password, from my script. How is this done?

推荐答案

有一个名为 SANUR.EXE 专门用于这种情况:您可以使用它在命令行中通过管道输入密码,如下所示:runas /user:domain\username cmd.exe | sanur mysekritpassword.

There's an executable program called SANUR.EXE that's made for just this kind of situation: you can use it to pipe in the password on the command-line, like this: runas /user:domain\username cmd.exe | sanur mysekritpassword.

这篇关于从Python将密码传递给runas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆