Advertisement
Guest User

Untitled

a guest
Mar 4th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. //кодируем пароль
  2. string password = "Test";
  3. SecureString secureString = new SecureString();
  4. foreach (char chr in password) secureString.AppendChar(chr);
  5.  
  6.  
  7.  
  8. Process pr = new Process();
  9. pr.StartInfo.UseShellExecute = false;
  10. pr.StartInfo.FileName = @"C:Users" + userName + @"DocumentsDLL2.bat";
  11. pr.StartInfo.Verb = "runas";
  12. pr.StartInfo.UserName = "admin";
  13. pr.StartInfo.Domain = "os";
  14. pr.StartInfo.Password = secureString;
  15. pr.Start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement