Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess,time
- psexecloc ="C:\Users\administrator\Desktop\sample\bin\psexec.exe"
- remotecmd="notepad.exe"
- username = "XXXr"
- password = "XXXXXXX"
- remotehostname = "XXXXXXXX"
- args =
- [psexecloc, "-u", username, "-p", password, remotehostname, remotecmd]
- output = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE)
- time.sleep(30)
- outstr=output.communicate()
- stdoutstr = outstr[0]
- stderrstr = outstr[1]
- print ("Output Tupple: ",outstr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement