Link to home
Start Free TrialLog in
Avatar of martinlest
martinlest

asked on

VBS Script in XP/WSH - No message box

The one line of script below always opened a message box with the chosen text. When I clicked the OK button, the box closed.

On one of my PCs this no longer happens, I get a quick flash of a cmd.exe window. VBS scripts which perform tasks still function, but I am missing the message box each time. On other PCs, the scripts work as usual, producing a message box.

Any ideas what has happened on that one machine and how I could correct it so that the MsgBox displays again? Windows Script Host seems to be installed OK, but if I right-click the script file and choose to open with WSH, I get the same thing - a quick flash of a command window, but no more.

Thanks,

Martin
WScript.Echo "Enable Control System"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of martinlest
martinlest

ASKER

Of course, I feel a fool now!! I set the script engine to cscript for a certain reason a few days back, then forgot to put it back to WScript - also forgetting that I'd done this apparently. As soon as I read your reply, I realised what had happened.

To get back to CScript, I use this, right? - wscript //H:cscript

Thanks!

Martin
cscript //H:cscript
Oh, I think I misunderstood something. Anyway, all OK now. Thanks again.

Martin