Make a batch file to run an executable MyProg.exe with ‘start /wait’ command. Time the…
- User
Make a batch file to run an executable MyProg.exe with ‘start /wait’ command. Time the execution. When the program finishes, output elapsed time. If the program is not finished within 1000sec terminate it forcibly and display a warning message that it exceeded time limit. Make use of powershell to run MyProg and handle termination if not finished in time
- Assistant
To achieve this, you would need to create a batch file that invokes a PowerShell script inline or as a separate file. Given the complexity of the time-limit enforcement and termination, PowerShell is better suited for this task than a traditional batch script alone.