简体   繁体   English

是否有 Python function 在 Windows 10 命令行提示时自动回答是?

[英]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.

相关问题 Python 模块请求在 anaconda 提示符下工作但不在 Windows 10 命令行中工作 - Python module requests working in anaconda prompt but not in windows 10 command line 如何从 Windows 10 命令提示符以“python filename.py funcname”格式运行 python 函数? - How to run a python function from Windows 10 command prompt in 'python filename.py funcname' format? 如何在 Windows 10 命令提示符下运行 python 程序 - How to run a python program in Windows 10 command prompt 命令提示符中的“python”不起作用(Windows 10) - "python" in command prompt doesn't work (windows 10) Windows 10 中的 Python 3.7 命令行问题 - Python 3.7 command line issues in Windows 10 如何使Python 3.9运行命令提示符windows 10? - How to make Python 3.9 run command prompt windows 10? 在Windows 10命令提示符中运行python时仍在运行python 2.7 - Still running python 2.7 when running python in windows 10 command prompt 使用命令提示符在 windows 10 pro、python3.8.0 中安装 jupyter notebook 时遇到错误 - facing an error while installing jupyter notebook in windows 10 pro, python3.8.0 using command prompt Python:从python脚本的Windows命令提示符中执行windows命令 - Python: Executing the windows command in windows command prompt from python script 如何在 Windows 命令提示符下运行 python 文件? - How to run a python file in the windows command prompt?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM