Allowing VB6 to use wscript

There are several answers on this site that use WScript.CreateObject to create a shell object for running a command from a shell.  These answers have all be accepted and I assume that they work.  However, when I try to implement them, I get a "Compile error: Sub or Function not defined" against the WScript command?  How do I access it?
dennis_j_bellAsked:
Who is Participating?
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.

Mike TomlinsonMiddle School Assistant TeacherCommented:
Can you show us your code please?...
0
dennis_j_bellAuthor Commented:
See http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21630472.html as an example...

Also, found this link with the same problem I have -- it seems some people can access WScript and some can't, so its obviously a reference/config problem:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20155040.html
0
vinnyd79Commented:
Have you tried using CreateObject without the Wscript. If your looking to run a command you could use the wscript run method:

Private Sub Command1_Click()
Dim wShell As Object
Dim sCmd As String

sCmd = "ping 127.0.0.1"

Set wShell = CreateObject("Wscript.Shell")
wShell.Run "%comspec% /k " & sCmd

Set wShell = Nothing
End Sub
0

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
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
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.