[英]Execute system commands using wmi python on remote computer
I am trying to create a directory on a remote computer using wmi and python. 我正在尝试使用wmi和python在远程计算机上创建目录。 I am able to successfully run any batch file by providing the complete path to it. 通过提供完整的路径,我能够成功运行任何批处理文件。 But not execute system command. 但不执行系统命令。
This following code does not create a directory on the remote computer. 下面的代码不会在远程计算机上创建目录。
conn = wmi.WMI('172.20.23.45', user='Administrator', password='Pass@123')
conn.Win32_Process.Create(CommandLine='mkdir temp')
可以这样做。
conn.Win32_Process.Create(CommandLine='cmd.exe /c mkdir temp')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.