Jump to content

Run an external command and wait for it to finish


MKANET
 Share

Recommended Posts

I was trying to figure out how to do this in a Windows batch file; but gave up trying.

I would like to execute the below command; and wait for it to terminate in memory, then, continue on with the script.

cmdow /run /hid C:\PROGRA~1\INTERN~1\iexplore.exe http://movies.netflix.com/WiHome

Ideally, I'd like to have autoit hide that window; which may reduce the complexity of the external command. However, I don't know how to do that Maybe someone where knows an nice way to do this.

Link to comment
Share on other sites

You don't need cmdow /hid to hide the ie's window, just use the flag @SW_HIDE

RunWait("C:PROGRA~1INTERN~1iexplore.exe http://movies.netflix.com/WiHome",'', @SW_HIDE)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there'sĀ InetReadĀ and WinHTTP, way better
happy.png

Link to comment
Share on other sites

  • Moderators

While the run feature is your specific question, but it doesn't hide the browser window, only the console window created if created at all, and it's no fun! :)

If you're trying to hide the browser window ( why in the world? ), then I'd suggest this ( where the 3rd param of _IECreate() has the option to show or hide on creation ).

#include <IE.au3>
Global $go_IEObj = _IECreate("http://movies.netflix.com/WiHome", 0, 0)
ProcessWaitClose(WinGetProcess($go_IEObj.hwnd))
Edited by SmOke_N
It added url tag to my string

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...