Launch SYSPREP in C#

后端 未结 3 1573
南旧
南旧 2021-01-26 05:00

I have found this via stack-overflow search but no one has given a solution that works. I am writing a simple program and the first part of it is to launch sysprep.exe with some

3条回答
  •  醉梦人生
    2021-01-26 05:32

    I think this is a permission problem, you can try run as admin

    Process process = new Process();
            ProcessStartInfo startInfo = new ProcessStartInfo();
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            startInfo.FileName ="cmd.exe";
            startInfo.Arguments = @"/c  C:\Windows\System32\sysprep\sysprep.exe";
            startInfo.Verb = "runas";
            process.StartInfo = startInfo;
            process.Start();
    

提交回复
热议问题