c# - Freezes waiting process -
i write code, call powershell script execute. problem on windows 7, works perfectly. in windows 8.1 1 start of 5 freezes. code:
processstartinfo startinfo = new processstartinfo(); startinfo.filename = @"powershell.exe"; startinfo.arguments = pathunistallscript; startinfo.redirectstandardoutput = true; startinfo.redirectstandarderror = true; startinfo.useshellexecute = false; startinfo.createnowindow = true; process process = new process(); process.startinfo = startinfo; process.start(); string output = process.standardoutput.readtoend();//here code freezes
at moment put crutch, think temporary solution.
process process = new process(); process.startinfo = startinfo; process.start(); thread.sleep(5000);//wait approximate number of seconds complete script process.kill();
how write code, not freezes in windows 8.1?
Comments
Post a Comment