I have a python script on my local machine related to a database. I can log in to that database server through a SSH connection. But how can I run my python file on that database server?
Do I need to upload my python script on that server machine? How can I do that?
I logged in to the database server through the ssh connection. I have access to that.
I ran my python file which is stored in my local machine on that server.
It shows "python3: can't open file .. No such file or directory"
I want to run the program and see the output.
How to delete specific file on Windows Remote Server using Python?
I'm able to connect to remote Windows Server using WMI, but not sure how to delete file remotely on windows server.
I try to run .bat file on remote machine.
From my machine i mapped the folder where my .bat (on the remote machine) is exist and from my machine i just try to run the file:
os.system(r'Y:\file.bat')
But it seems that nothing hapenning.
Any suggestions ?
BTW both machines are Windows
I connect remote server(via Remote desktop) using username/password.
How can I copy one file from my machine to that remote windows machine using python?
I want to run a local batch file on a remote system with WMI, instead of running a batch file on the remote system. The reason behind this is that I'll need the directory to which I'm referencing in the batch file to be variable, and adjustable by the user. How exactly can I do this? Reference the local file and run it, or send it to the remote sytem? How do I code it either way?
The reason I chose WMI was because it has been extremely reliable thus far, and I have no intention of reusing PsExec, and I have no need for ssh.
Referencing the local file on the remote system is bad because the remote system user has to have access to the file system on your local system which is - viewed by the remote system - a remote system.
You would have to have a share on your local machine which is accessible from the remote system and modify the batch to access the UNC-Path (pushd).
The best way would be to copy the batch to the remote system (or create it dynamically on the remote system) and execute it from there.
How to create remote processes can be read at this question,
several ways to copy files to a remote system are described here