Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keyboard clear buffer 1

Status
Not open for further replies.

qazi12345

Vendor
Mar 16, 2011
2
US
I have written many scripts for the installation and configuration of a server . All the scripts are interactive scripts. Yes or no interactive questions like

You are about to configure rootvg on LAB992 running 6.1
Do you want to continue? (Y/N)

If i press 'y' its gonna continue if 'n' its gonna continue with the next script. But if its a different letter ie i fat finger it , it aborts.

You are about to configure rootvg on LAB992 running 6.1
Do you want to continue? (Y/N)
t
Ok - we are aborting now

If i fatfinger it, i wanted the script to take a loop back and ask the same question. I tried to search for it but couldnt.

thanks
 
Use a loop:
Code:
Dim r
r = ""
Do While LCase(r) <> "y" And LCase(r) <> "n" 
	r = InputBox("Do you want to continue? (Y/N)")
Loop
Wscript.echo "Done."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top