Im trying to use the WScript object but when I try accessing a function (with the WScript object being used) it gives me a "WScript is undefined" error dialog box. Does anyone know how I can start using Windows Host Scripting (especially use the Echo method of it)?
You will have to do the following: 1) be writing client-side script on a windows PC for a windows PC. 2) create an instance of the WScript object you are interested in using. Here is an example I lifted from MSDN:
You can find the WSH reference here. HTH [ April 12, 2002: Message edited by: Bodie Minster ]
WSH is designed to be run outside the context of a browser. To use it in an HTML page, you will have to create an instance of some WSH object, just as you would for any other ActiveXObject. I haven't tried this yet, but you should be able to do something like this:
Well, I've done a little more looking into this and I have found the following: 1) WSH is intended to run standalone scripts. 2) it can be used as an ActiveX object, but you can't directly create an instance of the WScript object in this way. 3) If you create a .js file on your desktop and try using the Wscript.echo() you will have no troubles. Executing this in the browser presents a problem. I have not been able to figure out how to create an instance of "WScript.WScript" as an ActiveXObject. I was successful in creating "WScript.Shell" and executing some of its methods. Perhaps this would be a good time to step back and ask what is your ultimate goal with WSH? Maybe there is an easier or otherwise better way to get the job done?
Bodie, Thanks for all the replys. I've been looking into alternative ways of handling printing to a printer but with no luck. There are ways of doing it but there is way too much fooling around to do it. I can see why so many people just use printer-friendly pages. I was, however, wondering how Chapters allows their customers to print their orders directly to a printer in their in-store kiosks (or at least it's what I heard). Rob