Advertisement
Guest User

Untitled

a guest
Apr 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. string strFilePath = "C:\Users\myName\Desktop\LocalFolder\TheAppIWantToRun.py";
  2. System.Diagnostics.Process proc = new System.Diagnostics.Process();
  3.  
  4. proc.StartInfo.FileName = strFilePath;
  5. string pwd = "Pass123456";
  6.  
  7. proc.StartInfo.Domain = "tor-this-computer5";
  8. proc.StartInfo.UserName = "NAME-ORG\Username";
  9.  
  10. System.Security.SecureString secret = new System.Security.SecureString();
  11. foreach (char c in pwd)
  12.  
  13. secret.AppendChar(c);
  14.  
  15. proc.StartInfo.Password = secret;
  16. proc.StartInfo.UseShellExecute = false;
  17.  
  18. proc.StartInfo.WorkingDirectory = "psexec \\C:\Users\myName\Desktop\LocalFolder\ ";
  19.  
  20. proc.Start();
  21. while (!proc.HasExited)
  22. {
  23. proc.Refresh();
  24. // Thread.Sleep(1000);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement