Variable is undefined: 'Wscript'

I'm trying to restart a service and I get this error.

Microsoft VBScript runtime  error '800a01f4'

Variable is undefined: 'Wscript'

/Default.asp, line 14

I've installed windows scripting engine 5.6 so I thought it would work. Any ideas?

Option Explicit
Dim objShell, intShortSleep, intLongSleep
Dim strService
Set objShell = CreateObject("WScript.Shell")

' Values set
strService = " Alerter"
intShortSleep = 1500
intLongSleep = 5500

' Cmd prompt opened
objShell.Run "cmd"
Wscript.Sleep intShortSleep

' Service stopped with 'Net' command
objShell.SendKeys "net stop" & strService
Wscript.Sleep intShortSleep
objShell.SendKeys "{Enter}"
Wscript.Sleep intLongSleep

' Service started with 'Net' command
objShell.SendKeys "net start" & strService
Wscript.Sleep intShortSleep
objShell.SendKeys "{Enter}"
Wscript.Sleep intLongSleep

' Cmd prompt exited
objShell.SendKeys "Exit"
Wscript.Sleep intShortSleep
objShell.SendKeys "{Enter}"

Wscript.Echo strService & " service stopped "
WScript.Quit
LVL 1
jbrahyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thefritterfatboyCommented:
you could probably run:

You can't run wscript.sleep from ASP.

There's a very good reason for this, too:

http://blogs.msdn.com/ericlippert/archive/2003/10/07/53155.aspx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thefritterfatboyCommented:
ignore the first line of my response :p
inviserCommented:
Simply installing that engine will make Wscript a known identifier (variable) in any ASP script. You have to declare it and set it equal to a new object. The error you are getting makes sense since you haven't declared Wscript.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.