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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -