469,926 Members | 1,526 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

vbscript runtime error

drhowarddrfine
7,435 Expert 4TB
I've been running this VBScript, gracefully written by InsertAlias, for two days now and it's been perfect. Tonight, for no reason at all, it fails with this error:

Windows Script Host
Line:7
Char:1
Error:Permission denied
Code:800a0046
Source:Microsoft VBScript runtime error
Expand|Select|Wrap|Line Numbers
  1. 'define vars 
  2. url = "http://google.com"
  3. path = "C:\temp.txt"
  4. 'instantiate
  5. Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
  6. Set fso = CreateObject("Scripting.FileSystemObject")
  7. Set txtfile = fso.OpenTextFile(path, 2, True)
  8. Set oWS = WScript.CreateObject("WScript.Shell")
  9. 'make request
  10. xmlhttp.open "GET", url, false
  11. xmlhttp.send ""
  12. 'wait for response
  13. xmlhttp.waitForResponse()
  14. 'if status is 200, then it's OK
  15. if xmlhttp.status = 200 then
  16.     txtfile.WriteLine(xmlhttp.responseText)
  17.     txtfile.Close
  18.     'enable this to print
  19.     oWS.Run "NotePad.exe /p " + path
  20.     'enable this to just display
  21.     oWS.Run "notepad.exe " + path    
  22. else
  23.     'popup bad response, or just omit to end
  24.     WScript.Echo("bad response")
  25. end if
  26. 'destroy objects.  I'm not sure this is necessary
  27. Set txtfile = nothing
  28. Set xmlhttp = nothing
  29. Set oWS = nothing
  30. Set fso = nothing
Nov 25 '08 #1
3 5667
drhowarddrfine
7,435 Expert 4TB
Now hold on here. It's too late to do anything now but there might be an error on my end after all. Let me look into this in the morning.
Nov 25 '08 #2
Curtis Rutland
3,256 Expert 2GB
For the record, it would seem that it is a permissions error of some kind...
Code Error 800A0046 - Runtime error: Permission Denied VBScript
Nov 26 '08 #3
drhowarddrfine
7,435 Expert 4TB
The problem was caused by my server side code stuck in a test loop and feeding data continuously.
Nov 27 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by =?Utf-8?B?TWF0dCBDYWxob29u?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.