1' Set your settings
2strFileURL = "http://www.soft-haus.com/glest/tools/7z.exe"
3strHDLocation = ".\7z.exe"
4
5WScript.Echo "----------------------------------------"
6WScript.Echo "About to download 7z.exe from:"
7WScript.Echo strFileURL & ", please wait..."
8
9' Fetch the file
10Set objXMLHTTP =CreateObject("WinHttp.WinHttpRequest.5.1")
11If objXMLHTTP Is Nothing Then Set objXMLHTTP = CreateObject("WinHttp.WinHttpRequest")
12If objXMLHTTP Is Nothing Then Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
13If objXMLHTTP Is Nothing Then Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
14
15objXMLHTTP.open "GET", strFileURL, false
16objXMLHTTP.send()
17
18If objXMLHTTP.Status = 200 Then
19  Set objADOStream = CreateObject("ADODB.Stream")
20  objADOStream.Open
21  objADOStream.Type = 1 'adTypeBinary
22
23  objADOStream.Write objXMLHTTP.ResponseBody
24  objADOStream.Position = 0    'Set the stream position to the start
25
26  Set objFSO = Createobject("Scripting.FileSystemObject")
27  If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
28  Set objFSO = Nothing
29
30  objADOStream.SaveToFile strHDLocation
31  objADOStream.Close
32  Set objADOStream = Nothing
33  WScript.Echo "7z.exe has been downloaded successfully to: "
34  WScript.Echo strHDLocation
35  WScript.Echo "----------------------------------------"
36End if
37
38Set objXMLHTTP = Nothing
39
40' Set your settings
41strFileURL = "http://www.soft-haus.com/glest/tools/7z.dll"
42strHDLocation = ".\7z.dll"
43
44WScript.Echo "----------------------------------------"
45WScript.Echo "About to download 7z.dll from:"
46WScript.Echo strFileURL & ", please wait..."
47
48' Fetch the file
49Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
50objXMLHTTP.open "GET", strFileURL, false
51objXMLHTTP.send()
52
53If objXMLHTTP.Status = 200 Then
54  Set objADOStream = CreateObject("ADODB.Stream")
55  objADOStream.Open
56  objADOStream.Type = 1 'adTypeBinary
57
58  objADOStream.Write objXMLHTTP.ResponseBody
59  objADOStream.Position = 0    'Set the stream position to the start
60
61  Set objFSO = Createobject("Scripting.FileSystemObject")
62  If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
63  Set objFSO = Nothing
64
65  objADOStream.SaveToFile strHDLocation
66  objADOStream.Close
67  Set objADOStream = Nothing
68  WScript.Echo "7z.dll has been downloaded successfully to: "
69  WScript.Echo strHDLocation
70  WScript.Echo "----------------------------------------"
71End if
72
73Set objXMLHTTP = Nothing
74
75' Set your settings
76strFileURL = "http://www.soft-haus.com/glest/tools/wget.exe"
77strHDLocation = ".\wget.exe"
78
79WScript.Echo "----------------------------------------"
80WScript.Echo "About to download wget.exe from:"
81WScript.Echo strFileURL & ", please wait..."
82
83' Fetch the file
84Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
85objXMLHTTP.open "GET", strFileURL, false
86objXMLHTTP.send()
87
88If objXMLHTTP.Status = 200 Then
89  Set objADOStream = CreateObject("ADODB.Stream")
90  objADOStream.Open
91  objADOStream.Type = 1 'adTypeBinary
92
93  objADOStream.Write objXMLHTTP.ResponseBody
94  objADOStream.Position = 0    'Set the stream position to the start
95
96  Set objFSO = Createobject("Scripting.FileSystemObject")
97  If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
98  Set objFSO = Nothing
99
100  objADOStream.SaveToFile strHDLocation
101  objADOStream.Close
102  Set objADOStream = Nothing
103  WScript.Echo "wget.exe has been downloaded successfully to: "
104  WScript.Echo strHDLocation
105  WScript.Echo "----------------------------------------"
106End if
107
108Set objXMLHTTP = Nothing
109
110' Set your settings
111strFileURL = "http://www.soft-haus.com/glest/tools/tar.exe"
112strHDLocation = ".\tar.exe"
113
114WScript.Echo "----------------------------------------"
115WScript.Echo "About to download tar.exe from:"
116WScript.Echo strFileURL & ", please wait..."
117
118' Fetch the file
119Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
120objXMLHTTP.open "GET", strFileURL, false
121objXMLHTTP.send()
122
123If objXMLHTTP.Status = 200 Then
124  Set objADOStream = CreateObject("ADODB.Stream")
125  objADOStream.Open
126  objADOStream.Type = 1 'adTypeBinary
127
128  objADOStream.Write objXMLHTTP.ResponseBody
129  objADOStream.Position = 0    'Set the stream position to the start
130
131  Set objFSO = Createobject("Scripting.FileSystemObject")
132  If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
133  Set objFSO = Nothing
134
135  objADOStream.SaveToFile strHDLocation
136  objADOStream.Close
137  Set objADOStream = Nothing
138  WScript.Echo "tar.exe has been downloaded successfully to: "
139  WScript.Echo strHDLocation
140  WScript.Echo "----------------------------------------"
141End if
142
143Set objXMLHTTP = Nothing
144