[英]Is there a Python function to automatically answer yes on prompt in Windows 10 Command Line?
I want to use Python to execute this command in Windows 10 command-line:我想使用 Python 在 Windows 10 命令行中执行此命令:
"C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe" connect [some_server] “C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe”连接 [some_server]
and after that to automatically answer "y" on "Connect Anyway" prompt.然后在“无论如何连接”提示中自动回答“y” 。 Which is the best way to do that?哪种方法最好?
Thanks.谢谢。
This should run the exe file and send a "y" upon running it.这应该运行 exe 文件并在运行时发送“y”。
os.system('cmd /c' "echo y | C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\vpncli.exe")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.