1 Replies - 927 Views - Last Post: 25 June 2012 - 09:37 AM Rate Topic: -----

#1 Dodo8  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 21-May 12

Problem with closing a .vbs Program

Posted 02 June 2012 - 03:17 AM

Hello! I have a problem with my program. After I close it, without pressing "Ok", the program will still work. I'm a newbie so I don't know how to fix it. Here it is:
'
' Find the latest Empires & Allies version
'
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")

version = CLng(InputBox("Enter the highest known Game Version:", "Userinput"))

Dim lastURL
Dim lastVersion
Dim maxVersion

maxVersion = version + 400

While version < maxVersion

    tryURL = "http://empire-zc.static.zgncdn.com/assets/" & CStr(version) & "/gameSettings.xml"

    objXMLHTTP.open "HEAD", tryURL, false
    objXMLHTTP.send()

    If objXMLHTTP.Status = 200 Then
       lastURL = tryURL
       lastVersion = version
       maxVersion = version + 400
    End if

    version = version + 1
Wend

Set objXMLHTTP = Nothing

If lastURL <> "" Then
    WScript.Echo "The Latest Version is: " & lastVersion
Else
    WScript.Echo "Could not find the Latest Version"
End If


:helpsmilie:

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with closing a .vbs Program

#2 denting5  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 84
  • Joined: 03-June 12

Re: Problem with closing a .vbs Program

Posted 25 June 2012 - 09:37 AM

You could try putting in a WaitKey at the end, so that it will close with a key stroke. That should close it a charm.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1