python - how to execute commands on remote machine using pysphere -
have vmware vm on wanted execute commands example shutdown /r or dir /o:d etc... remote machine. using module pysphere module communicating vm.
i tried start_process creating process cmd.exe code creating process vm_object.start_process('cmd.exe', args=["shutdown /r"])
when run command cmd.exe need add /c:
cmd.exe /c shutdown /r
as explained here, need tell cmd.exe run parameter passed string. command running cmd.exe without issuing command passed parameter. /c flag instructs cmd.exe execute parameter passed.
Comments
Post a Comment