I am automating the process of starting IIS Express then starting ngrok and opening a web page automatically in order to browse a site. Unfortunately I am stuck at the final hurdle because once ngrok starts the final line of the batch file to open the page will not run until the ngrok process ends which is obviously not very helpful.
Example:
ngrok http -subdomain=mysubdomain 192.168.0.2:%port%
:: Pause for 3 seconds as IIS Express takes a moment to start
timeout /t 3
:: launch the browser pointing to this location
start /B "" http://mysubdomain.ngrok.io
If I alter the line that starts ngrok (as below) everything runs as I want but I lose the ability to interact with ngrok once the page has opened:
start /B "" ngrok http -subdomain=mysubdomain 192.168.0.2:%port%
Can I achieve what I want in just a batch file and if so what am I missing? I really want to keep this self contained and portable in a single batch file if I can.