Hi,

I'm writing a vbs script for use in Generic Script Resource of
Microsoft Cluster. My script use the function WScript.Sleep, but I have
the error: 500 "Variable is undefined", when executed by
ClusterService. Why? When the script running without Cluster the Sleep
function work perfectly.

Thanks for help
John.

Re: WScript.Sleep can't use on cluster resource script by John

John
Wed Jan 04 05:42:57 CST 2006

Can I use an alternative method for sleep my script? With API of
Windows not is possible?

Thanks.


Re: WScript.Sleep can't use on cluster resource script by JHP

JHP
Wed Jan 04 08:38:14 CST 2006

Found this:
Here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetserv/html/wns-introclustermscs.asp

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Wait for a specified number of time.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Sleep( PauseTime )
Dim Start

Start = Timer

Do While Timer < Start + PauseTime
Loop

End Sub

"John" <enz_tn2002@yahoo.com> wrote in message
news:1136374977.235874.9100@o13g2000cwo.googlegroups.com...
> Can I use an alternative method for sleep my script? With API of
> Windows not is possible?
>
> Thanks.
>



Re: WScript.Sleep can't use on cluster resource script by axtens

axtens
Wed Jan 04 20:02:11 CST 2006

Either that or

'derived from
http://dev.remotenetworktechnology.com/wsh/rubegoldberg.htm
Sub Snooze( nSeconds )
Dim oShell
Dim sCmd
Set oShell = CreateObject( "WScript.Shell" )
sCmd = "%COMSPEC% /c ping -n " & 1 + nSeconds & " 127.0.0.1>nul"
oShell.Run sCmd,0,True
Set oShell = Nothing
End Sub

... Bruce


Re: WScript.Sleep can't use on cluster resource script by \

\
Thu Jan 05 07:55:38 CST 2006

Either of those will work, although JHP's scheme will keep the CPU maxed out for
the duration. For applications where wscript is not available, I use a third
party utility called ASPTime.dll. It makes life simpler, works internally, and
does not hog resources.

http://hosting.ats-ltd.co.uk/guides/asptime.htm
http://www.cs.niu.edu/%7Ez951259/asptime.zip
--
Crash