代码如下:
调用的命令:reg export exportPath registryKey -y
Process proc = new Process(); proc.StartInfo.FileName = "CMD.exe"; proc.StartInfo.Arguments = "/c reg export exportPath registryKey -y"; proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; proc.Start(); proc.WaitForExit();
结果就不会显示任何窗口,并且不会有窗口一闪而过的情况