Trouble with VB script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jumbojs
    New Member
    • May 2009
    • 20

    Trouble with VB script

    I have a .bat file that I run every night to "hit" a webpage. The batch file has one argument, the URL

    > webrun.vbs http://111.111......

    Here is the webrun.vbs script below. Anyway, I'm running this script on two servers. One has DNS set up and is accessed like http://www.domainname. com

    The other server doesn't have DNS set up yet and is accessed by ip like http://209.xxx.xxx

    When I access the page by IP nothing happens. I have no idea why it won't work here. Any help

    Code:
    dim URL, oArgs  
    
    Set oArgs = WScript.Arguments  
    
        if oArgs.Count = 0 then  
        msgbox("Error: Must supply URL")  
        wscript.quit 1  
        end if  
    
    URL = oArgs(0)  
    
     on error resume next  
    Set objXML = WScript.CreateObject("MSXML2.ServerXMLHTTP")  
    
        if err then  
        msgbox("Error: " & err.description)  
        wscript.quit 1  
        end if  
    
    ' Call the remote machine the request  
        objXML.open "GET", URL, False  
    
    
    
        objXML.send()  
    
    ' return the response  
        msgbox objXML.responsetext 
    
    
    ' clean up  
        Set objXML = Nothing
    
    WScript.Echo "Done..."
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    if you ping the domain name do you get the same IP that you are using in the IP version of the .bat

    Comment

    Working...