David I. McIntosh
David I. McIntosh

Reputation: 2130

Make MFC Modal (synchronous)

I have crated an MFC GUI application (blah.exe), and it works fine. I need to use it in a powershell script, and I need the script to wait for the .exe application to finish. But the .exe runs itself asynchronously, i.e. the invoking process does not wait for it to finish. How do I change this?

The application was created in Visual Studio 2010 with the standard MFC app wizard.

Upvotes: 0

Views: 110

Answers (1)

Andrew Komiagin
Andrew Komiagin

Reputation: 6556

You should start your application using the following command in PowerShell:

Start-Process <path to exe> -NoNewWindow -Wait

Upvotes: 2

Related Questions