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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pausing in Vbscript without using wscript.sleep

Status
Not open for further replies.

DaiDreamer

Programmer
May 8, 2001
31
US
Is there a way to pause a vbscript without using wscript.sleep?

Thanks!

DaiDreamer
 

daidreamer;

This will work,

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.popup "waiting for 3 seconds", 3

Cheers;
Fengshui1998
 
You can also do it by calling QBASIC -

I actually use this in a batch file, but if you used FSO to write out a TEMP .batch file, you could execute it. Here's what the batch file needs to look like. PS - This works on NT 4.0, that I know of, because it has the "qbasic.exe" file in C:\WINNT\system32. I've also made it work on Win2K, which doesn't have QBASIC, but you can copy the file in and it works like a charm.

@echo off
>%temp%\sleep.$@$ echo sleep 5
>>%temp%\sleep.$@$ echo system
qbasic /run %temp%\sleep.$@$

Hope it helps.
 
This worked for me:

Code:
	'sleep 
	varNow = Now
	while DateDiff(&quot;s&quot;,varNow,Now) < 2 
	wend

NOTE: 2 is the time interval.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top