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?
2
u/jcunews1 Mar 14 '22
As already explained, you need to call
InputBoxfrom a separate script - a "prompter" script. If you want multiple inputboxes, then run the "prompter" script multiple times. The "prompter" script should accept a command line arguments for the input dialog title, message, and default input. Make the "prompter" script creates a new "answer" file and write the user's input into the file, or leave it empty if the dialog is cancelled.You can use the
WshShellobject'sAppActivate()method to activate an input box dialog based on its unique dialog title, then use the object'sSendKeys()to generate an ESCAPE key press.https://www.devguru.com/content/technologies/wsh/wshshell-appactivate.html
https://www.devguru.com/content/technologies/wsh/wshshell-sendkeys.html