Safest way to run BAT file from Powershell script

前端 未结 5 1763
眼角桃花
眼角桃花 2020-12-07 12:58

I can not get a powershell script to execute a bat file directly. For example, this works on the command line:

.\\\\my-app\\my-fle.bat

When

5条回答
  •  囚心锁ツ
    2020-12-07 13:30

    To run the .bat, and have access to the last exit code, run it as:

     & .\my-app\my-fle.bat
    

提交回复
热议问题