Thanks guys. I probably should have explain what I'm trying to achieve; and, what I've tried already.
This is part of a bigger batch file to make Internet explorer maximize, then restore it's position to avoid a cosmetic bug when forcing it to run without a addressbar, menubar, etc; leaving only the window frame. I wanted to hide it while it's being maximized and unhide it after it's been restored to its windowed position.
I've actually already tried banging away against tasklist using a similar method (not as effective as yours though) before I even posted here. It was actually working.
Code: Select all
:waittofinish
tasklist /FI "IMAGENAME eq iexplore.exe"| find /I /N "iexplore.exe" >nul
if not errorlevel 1 goto waittofinish
But, discarded that idea due to it wasting too much CPU cycles. Especially, since it has to constantly do this during the duration of a movie; which is a very CPU sensitive task. I had even tried adding a delay in the loop. But, the whole idea didn't sound appealing to me. Which is what brought me to this forum... I was really hoping for someone to figure out a clever way of using "Start /wait"; if at all possible; which doesn't waste any CPU cycles. I thought if there was any way to do this, someone where would be able to figure out how.
The whole purpose of this batch file it to run Internet Explorer in a windowed-kiosk mode for Netflix. This would have been so much easier if there wasn't a cosmetic bug when enabling NoNavBar=1 on my system. Maximizing and restoring the window displays it correctly. I wanted the batch file to hide it while it's maximized and unhide it after it's restored to it's position.
I thought about doing this in autoit; especially since I could use existing code which hides, unhides, activates, minimize, maximizes windows using
WinSetState($title, "", @SW_HIDE), WinSetState($title, "", @SW_SHOW), etc; but I preferred to do this in a batch file since I'm more comfortable using batch files; even if there's a little help from external command line apps.
If there's absolutely no way to do this, I'll have to settle for using tasklist with something like a 5 second delay in the loop.