Hello
I have a VBScript that sometimes works fine but often sucks - problem
in combination with WSH? 1st here is the part of the script making
trouble:
(note: following URL is an example)


private function writefile()
GetURL = www.someurl.com\index.php3?TYPE=Right

Dim Http
Set Http = CreateObject("Microsoft.XMLhttp")
Http.Open "GET",GetURL,False
Http.Send
HtmlResult = Http.ResponseText
HtmlResult = right(HtmlResult, len(HtmlResult) - instr(HtmlResult,
"<!-- Daten... -->"))
HtmlResult = left(HtmlResult, len(HtmlResult) - instr(HtmlResult,
"</body>"))

Set Http = Nothing

set fs=CreateObject("Scripting.FileSystemObject")
set f1=fs.CreateTextFile("test.tmp",true)

f1.write(HtmlResult)
f1.close
set f1=nothing
set fs=nothing
writefile = "Tempfile written."
end function


OK however the script only works when:
- I installed WSH 5.6 (is there a localized version oder only english?)
and reboot
- and run this script (in a Application supporting VBS-files) and it
works fine but
- after next reboot the Script terminates and also the application
script is running in terminates unexpected without promting or an
failure message.

Only when I re-install the WSH and after 1st reboot script also works.
So is this a WSH-Bug or where's the problem?
Note: I guess, the problem is the .write - routine because when the
script terminates, no such file has been written.

Kind regards, Torsten
--
"Outside is where the pizza comes from"