How to execute python script on remote with python way..?

Hi all,

I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine..

Below is the code I am trying:

#!/usr/bin/env python
import wmi

c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")
process_startup = c.Win32_ProcessStartup.new()
process_id, result = c.Win32_Process.Create(CommandLine="C:\Python27\abtest.py")
if result == 0:
  print("Process started successfully: %d" % process_id)
print(result)

connection is established successfully. But its not executing the python script..
if i had to do it manually then on remote i will got c:\phhton27 manually then run at prompt like below

c:/python27> python abtest.py

How can I put above command in .Win32_Process.Create format ?

Please guide.

Hmm... These are UNIX and Linux Q&A forums.

You have a Windows issue, so I'm moving this question over to the Windows forum.