why vbs shell script can not support sleep command

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

why vbs shell script can not support sleep command

Post by nieaicai »

hello
windows environment i can use wscript.sleep,
but in hostmonitor vbs shell script environment why can not use wscript.sleep it say lack of wscript
please who can help?
tks much
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Do not see any problems with VB sleep command in Shell Script test.
You may try the following demo script that works well on our system:

Code: Select all

Option Explicit
On Error Resume Next

const statusOk          = "scriptRes:Ok:"
const statusBad         = "scriptRes:Bad:"
const statusUnknown     = "scriptRes:Unknown:"

dim objArgs, sl
Set objArgs = WScript.Arguments
if (objArgs.Count<1) then
  WScript.StdOut.Write statusUnknown&"One parameter required <sleep time in milliseconds>"
  WScript.Quit
end if

sl = CInt(objArgs(0))
 If Err.Number <> 0 Then
      WScript.StdOut.Write statusUnknown&"["&objArgs(0)&"] "&Err.Description
      WScript.Quit
 End If

WScript.sleep sl

WScript.StdOut.Write statusOk&"Sleep time: "&sl&"ms"
Start CMD: cmd /c cscript /B /E:VBScript %Script% %Params%

Script requires one parameter <seep time in milliseconds>
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

Post by nieaicai »

i go to try
tks much
just waiting my result.
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

thanke you

Post by nieaicai »

after try
now work fine !!!!
tks very much!
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome!
Post Reply