Część. Potrzebuje napisać program *.exe w c#, który będzie pozwalał na wykonanie sfc /scannow . Poniżej wysyłam kod, który kompiluje i wykonuje jako administrator, ale niestety wyskakuje błąd: Windows Resource Protection could not start the repair service.
public static void run()
{
Process p = new Process();
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "cmd.exe";
info.RedirectStandardInput = true;
info.UseShellExecute = false;
p.StartInfo = info;
p.Start();
using (StreamWriter sw = p.StandardInput)
{
if (sw.BaseStream.CanWrite)
{
sw.WriteLine("echo on");
sw.WriteLine("sfc /scannow");
Console.ReadKey();
}
}
Prosiłbym o pomoc