How to open a prompt dialog box in WSH usig JScript??
The only pop-up dialog I've found in the doc is the WshShell.Popup() method. But I need a way to request the user to enter a string, like the window.prompt() method in DOM.
Thanks.
I think the WScript object does not provide such a method however you can show an input box from vbscript running on WSH. So here is one possible solution which lets you call that VB function from within JS! Please note the file extension for the following code fragment ".wsf".
<!-- Test.wsf -->
<job id="InputBoxInJS">
<script language="VBScript">
Function VBInputBox(promptText)
VBInputBox = InputBox(promptText)
End Function
</script>
<script language="JScript">
WScript.Echo("Hello from JScript")
var x = VBInputBox("Enter text")
WScript.Echo(x)
</script>
</job>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With