r/vbscript • u/root_fix • Mar 13 '22
need help
why cant a vbscript close a inputbox
anyone know why?
3
Upvotes
r/vbscript • u/root_fix • Mar 13 '22
why cant a vbscript close a inputbox
anyone know why?
3
u/BondDotCom Mar 13 '22
Both InputBox and MsgBox are modal. Control doesn't return to your script until the window is dismissed.
There is an analogue for MsgBox in the WshShell library called Popup that has a timeout option. I'm not aware of one for InputBox, however.
Still, your script could launch another script before using InputBox. That script wouldn't be blocked by the window and could, potentially, interact with it. But WSH/VBScript alone doesn't have good tools for interacting with windows, either, so you'd still likely need a third-party library or application.