Python Forum
help need with running python script on remote windows machine
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help need with running python script on remote windows machine
#1
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:
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.py
How can I put above command in .Win32_Process.Create format.

please guide..
Reply


Messages In This Thread
help need with running python script on remote windows machine - by onenessboy - Dec-14-2018, 01:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  No Internet connection when running a Python script basil_555 8 568 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 459 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Triggering a ps1 script in remote windows server via http python request jasveerjassi 1 360 Jan-26-2024, 07:02 PM
Last Post: deanhystad
  Help Running Python Script in Mac OS emojistickers 0 331 Nov-20-2023, 01:58 PM
Last Post: emojistickers
  Trying to make a board with turtle, nothing happens when running script Quascia 3 652 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  i tried to install python for the first time today and pretty certain im being remote brianlj 2 536 Oct-03-2023, 11:15 AM
Last Post: snippsat
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,165 Jun-29-2023, 11:57 AM
Last Post: gologica
  Python script running under windows over nssm.exe JaroslavZ 0 700 May-12-2023, 09:22 AM
Last Post: JaroslavZ
  Running script with subprocess in another directory paul18fr 1 3,663 Jan-20-2023, 02:33 PM
Last Post: paul18fr
  PsInfo from remote computer in python susja 3 2,249 Oct-10-2022, 08:39 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020