The thing is I want to run a batch file in system context. I will just drag and drop the batch file on the exe file (icon). Now, it should automatically open psexec and run the batch file in system context. I have the code. But the only problem lies here: the cmd is not running as admin due to which psexec won't run. Please, can someone point me out where I'm going wrong
Process process = new Process();
process.StartInfo.FileName = "psexec.exe";
process.StartInfo.Arguments = " -i -s -accepteula cmd /c \" msiexec /i " + fPath + " /qn /l*v \u0022%~dp0" + fileName + "\u0022 \"";
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.Verb = "runas.exe";
process.Start();
process.WaitForExit(60000);