Category : psexec

I am trying to remotely execute a script using PsExec and return live output using subprocess.Popen within my Tkinter program. Everything worked fine using below code. I did not need the shell=True parameter for Popen. process = subprocess.Popen( "psexec computer -c -f -s commands.cmd", stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) while True: line = process.stdout.readline() When i tried ..

Read more

from pypsexec.client import Client server = servername username = username password = password executable = "notepad.exe" c = Client(server, username=username, password=password) c.connect() print("Connected") try: c.create_service() result = c.run_executable(executable) finally: c.remove_service() c.disconnect() It is getting connected to the remote VM. But not able to open notepad in remote system. Source: Python..

Read more