HEELPBOOK - 2 ALTERNATIVES ON HOW TO SET A DELAY (VBSCRIPT) ################# You could use 2 methods to set a deley in code, using VBScript: the "ping" or "sleep" approach. ###### PING Approach Sub subSleep(strSeconds) ' subSleep(2) Dim objShell Dim strCmd set objShell = CreateObject("wscript.Shell") 'objShell.Run cmdline,1,False strCmd = "%COMSPEC% /c ping -n " & strSeconds & " 127.0.0.1>nul" objShell.Run strCmd,0,1 End Sub ###### SLEEP Approach Function MySleep(milliseconds) set WScriptShell = CreateObject("WScript.Shell") WScriptShell.Run "Sleep -m " & milliseconds, 0, true End Function ############ ARTICLE INFO ############# Article Month: January Article Date: 29/01/2013 Permalink: http://heelpbook.altervista.org/2013/2-alternatives-on-how-to-set-a-delay-vbscript/ Source: http://stackoverflow.com/questions/1729075/how-to-set-delay-in-vbscript Language: English View more articles on: http://www.heelpbook.net/ Follow us on Facebook: http://it-it.facebook.com/pages/HeelpBook/100790870008832 Follow us on Twitter: https://twitter.com/#!/HeelpBook Follow us on RSS Feed: http://feeds.feedburner.com/Heelpbook Follow us on Delicious: http://delicious.com/heelpbook Linkedin: http://it.linkedin.com/pub/stefano-maggi/27/73a/b20 Google+ : https://plus.google.com/116990277568167008289/posts