Sep-24-2021, 04:57 AM
Greetings!
I have a remote host(windows) and a system(windows based) connected to it by a private network.
The host has Python 27 on it.
Once a day a Python script runs (scheduled run) on it,
It is mapping the system C: drive as an A: drive and copies files to the host from some directory,
also it does some other stuff. It runs fine, no problems.
I wanted to run the script on the host remotely from my server (windows, with Python 3.9) instead of running it from the Windows scheduler.
I found if I call the script it runs (does some other stuff) but it does not copy files.
No errors. When I run manually it does everything, including copying files.
Any idea who to fix this?
Here is a script to execute a script on a remote host:
I have a remote host(windows) and a system(windows based) connected to it by a private network.
The host has Python 27 on it.
Once a day a Python script runs (scheduled run) on it,
It is mapping the system C: drive as an A: drive and copies files to the host from some directory,
also it does some other stuff. It runs fine, no problems.
I wanted to run the script on the host remotely from my server (windows, with Python 3.9) instead of running it from the Windows scheduler.
I found if I call the script it runs (does some other stuff) but it does not copy files.

No errors. When I run manually it does everything, including copying files.

Any idea who to fix this?
Here is a script to execute a script on a remote host:
import wmi from socket import * ip = 'xx.x.xxx.x' username = 'user' password = 'pass' try: print("Establishing connection to %s" %ip) connection = wmi.WMI(ip, user=username, password=password) print("Connection established") connection.Win32_Process.Create(CommandLine=r"C:\Python27\python.exe C:\02\SubPrOc-Get-L_TESTING.py") except wmi.x_wmi: print("Your Username and Password of "+getfqdn(ip)+" are wrong.") exitThank you.