我正在尝试使用wmi连接到远程Windows服务器
import wmi
dest = "IP"
usr = "USERNAME"
pwd = "PASSWORD"
conn = wmi.WMI(dest, user=usr, password=pwd)
process_startup = conn.Win32_ProcessStartup.new()
process_startup.ShowWindow = 1
process_id, result = conn.Win32_Process.Create(CommandLine=r'cmd.exe /c |copy "C:\\test\\test.txt" "c:\\test\\test_part1.txt"',ProcessStartupInformation=process_startup)
if result == 0:
print("Process started successfully ",process_id, result)
然后它成功运行了,但是当我尝试这个时
CommandLine=r'cmd.exe /c |copy "path to My shared or network drive" "c:\\test\\test_part1.txt"'
然后失败了。请帮助我