PsExec hang while being executed from a very simple c# or c++ gui program compiled as “windows application”

前端 未结 6 808
日久生厌
日久生厌 2021-01-18 12:04

I am experiencing PsExec hang while being executed from a very simple c# or c++ gui program compiled as \"windows application\" (not as \"console application\"). Under sect

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-18 12:17

    I have a simple solution for this,

    1. C# run the process like:

      Process.Start("start run.bat xx.txt");    //call it async
      
      //and then we make some code juse wait xx.txt appear and finish written .
      
    2. run.bat is :

      psexec.bat > %1           //redirect to a text file
      exit
      
    3. psexec.bat is:

      psexec.exe ..........................
       exit
      

提交回复
热议问题