Dec-14-2018, 01:57 PM
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:
if i had to do it manually then on remote i will got c:\phhton27 manually then run at prompt like below
please guide..
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:
Code: #!/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.pyHow can I put above command in .Win32_Process.Create format.
please guide..