Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import wmi, time, socket
  2. ip = '192.168.1.2'
  3. username = "Yamuna"
  4. password = "yamuna"
  5. SW_SHOWNORMAL = 1
  6. from socket import *
  7. print ("Establishing connection to %s")
  8. c = wmi.WMI(ip, user=username, password=password)
  9. process_startup = c.Win32_ProcessStartup.new()
  10. process_startup.ShowWindow = SW_SHOWNORMAL
  11.  
  12. process_id, result = c.Win32_Process.Create(CommandLine=r"D:t.bat",
  13. ProcessStartupInformation=process_startup)
  14.  
  15. if result == 0:
  16. print ("Process started successfully: %d")
  17. else:
  18. print("Problem creating process: %d")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement