Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #12313
| Newsgroups | microsoft.public.scripting.vbscript |
|---|---|
| Subject | Re: Waiting for keypress in a console - I've got problems. |
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
| References | <rscnqt$346$1@gioia.aioe.org> |
| Date | 2020-12-28 17:16 +0100 |
| Message-ID | <XnsACA1AFCE66BAeejj99@194.109.6.166> (permalink) |
"R.Wieser" <address@not.available> wrote on 28 Dec 2020 in
microsoft.public.scripting.vbscript:
> Hello all,
>
> I run scripts in a console window, and sometimes need to have them wait
> for a keypress before continuing. For that I found the below code :
>
> - - - - - - - - - - - - - - - - - - - -
> Wscript.StdOut.Write vbNewLine & "Press ENTER to continue. "
>
> Do While Not WScript.StdIn.AtEndOfLine
> Input = WScript.StdIn.Read(1)
> Loop
> - - - - - - - - - - - - - - - - - - - -
If you are content with 'enter':
===================
WScript.Echo "Press [ENTER] to continue..."
' This will not return until [ENTER] is pressed.
WScript.StdIn.ReadLine
WScript.Echo "Done."
===================
Or with a box:
===================
MsgBox("Press [ENTER] to continue...")
WScript.Echo "Done."
===================
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar
Waiting for keypress in a console - I've got problems. "R.Wieser" <address@not.available> - 2020-12-28 14:50 +0100
Re: Waiting for keypress in a console - I've got problems. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-28 17:16 +0100
Re: Waiting for keypress in a console - I've got problems. "R.Wieser" <address@not.available> - 2020-12-28 18:18 +0100
Re: Waiting for keypress in a console - I've got problems. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-29 00:21 +0100
Re: Waiting for keypress in a console - I've got problems. "R.Wieser" <address@not.available> - 2020-12-29 08:28 +0100
Re: Waiting for keypress in a console - I've got problems. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-12-29 13:26 +0100
Re: Waiting for keypress in a console - I've got problems. "R.Wieser" <address@not.available> - 2020-12-29 14:46 +0100
Re: Waiting for keypress in a console - I've got problems. JJ <jj4public@gmail.com> - 2020-12-29 11:44 +0700
Re: Waiting for keypress in a console - I've got problems. "R.Wieser" <address@not.available> - 2020-12-29 08:26 +0100
csiph-web