I have a vbscript that runs on the command line in xp. It accepts one argument for the path to a directory. Is there a simple way to prompt the user in the command line box for this?
If not, I can just echo what was passed in to show the user what they actually typed in case of typos.
Thanks,
James
Aftermath:
Here is the code I ended up with:
On Error Resume Next
strDirectory = InputBox(Message, Title, “For example – P:\Windows\”)
If strDirectory = "" Then
'Wscript.Echo cancelledText
Else
'Wscript.Echo enteredText & strDirectory
etc...
I found some snippets and it turned out to be really simple to work with the inputBox.
HTH.
James
You can use the
WScript.StdInproperty to read from the the standard input. If you want to supply the path when invoking the script, you can pass the path as a parameter. You’ll find it in theWScript.Argumentsproperty.