Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string strFilePath = "C:\Users\myName\Desktop\LocalFolder\TheAppIWantToRun.py";
- System.Diagnostics.Process proc = new System.Diagnostics.Process();
- proc.StartInfo.FileName = strFilePath;
- string pwd = "Pass123456";
- proc.StartInfo.Domain = "tor-this-computer5";
- proc.StartInfo.UserName = "NAME-ORG\Username";
- System.Security.SecureString secret = new System.Security.SecureString();
- foreach (char c in pwd)
- secret.AppendChar(c);
- proc.StartInfo.Password = secret;
- proc.StartInfo.UseShellExecute = false;
- proc.StartInfo.WorkingDirectory = "psexec \\C:\Users\myName\Desktop\LocalFolder\ ";
- proc.Start();
- while (!proc.HasExited)
- {
- proc.Refresh();
- // Thread.Sleep(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement