Avatar of itnifl
itniflFlag for Norway

asked on 

Pause a vbs script until user presses enter

I use the following ciode in VBS to pause a script until the user presses enter. But it looks like this only works the first time the Sub is called. Is there a way around that?
Sub pauseScript()
	Dim strMessage, Input
	strMessage = vbNewLine & "Press ENTER to continue."
	Wscript.StdOut.Write strMessage
	WScript.Echo vbNewLine & "(CTRL-C) to cancel."

	Do While Not WScript.StdIn.AtEndOfLine
		Input = WScript.StdIn.Read(1)
	Loop
End Sub

Open in new window

VB Script

Avatar of undefined
Last Comment
itnifl
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of itnifl
itnifl
Flag of Norway image

ASKER

Thanks!
VB Script
VB Script

VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.

39K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo