Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » vbscript: cannot use parenthesis when calling sub
Closed Thread
Old 05-06-2009, 08:03 PM   #1 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default vbscript: cannot use parenthesis when calling sub

throws an error

cannot use parenthesis when calling a sub

i'm calling a function, what can I do to fix this?

Code:
file1 = "http://www.devguru.com/technologies/wsh/17413.asp"

downloadfile(file1, "c:\file.html")



function downloadfile(strFileURL, strHDLocation)

'http://blog.netnerds.net/2007/01/vbscript-download-and-save-a-binary-file/

' Fetch the file
    Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
 
    objXMLHTTP.open "GET", strFileURL, false
    objXMLHTTP.send()
 
    If objXMLHTTP.Status = 200 Then
      Set objADOStream = CreateObject("ADODB.Stream")
      objADOStream.Open
      objADOStream.Type = 1 'adTypeBinary
 
      objADOStream.Write objXMLHTTP.ResponseBody
      objADOStream.Position = 0    'Set the stream position to the start
 
      Set objFSO = Createobject("Scripting.FileSystemObject")
        If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
      Set objFSO = Nothing
 
      objADOStream.SaveToFile strHDLocation
      objADOStream.Close
      Set objADOStream = Nothing
    End if
 
    Set objXMLHTTP = Nothing

end function

office politics is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 2008: schedule vbscript as task? office politics Windows Operating Systems and Software 0 01-14-2009 12:04 PM
VBScript in RunOnce Key JohnAlpha Windows Operating Systems and Software 2 08-04-2008 06:46 PM