Error, Object Required "Wscript" 
Author Message
 Error, Object Required "Wscript"

I ran the following code to learn WSH and got the indicated error.

What did I leave out?

<html>
<SCRIPT LANGUAGE="VBScript">

Dim WshSHell
set WshShell = CreateObject("WScript.Shell")

'The following example echoes the directory where the executable
' file resides:

WScript.Echo WScript.Path

'Error  Object required "Wscript"

</SCRIPT>
</html>



Wed, 22 May 2002 03:00:00 GMT  
 Error, Object Required "Wscript"

For HTML script, WScript isn't the host (the browser is) so the "built-in" WScript object doesn't exist...

--
Michael Harris


  I ran the following code to learn WSH and got the indicated error.

  What did I leave out?

  <html>
  <SCRIPT LANGUAGE="VBScript">

  Dim WshSHell
  set WshShell = CreateObject("WScript.Shell")

  'The following example echoes the directory where the executable
  ' file resides:

  WScript.Echo WScript.Path

  'Error  Object required "Wscript"

  </SCRIPT>
  </html>



Wed, 22 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VBScript "Object Required WScript" Error

2. "Object Required" error

3. "Object Required" error

4. detecting "object required" or null object

5. detecting "object required" or null object

6. window.open - "Object required"

7. Object Required "txtPrice"

8. Set WSHShell = WScript.CreateObject("WScript.Shell")

9. "Uspecified Error" when creating document object

10. Error: object required: 'WScript'

11. "required resource already in use"

12. can't CreateObject("Wscript.Shell")

 

 
Powered by phpBB® Forum Software