编剧,
我是新的VB脚本世界!
我想通过脚本来完成以下工作,这样我就可以安装Flash了。
步骤如下:
1. Open Internet Options.
2. Click on “Connections” tab.
3. Click on “LAN Settings” button.
4. Deselect the “Automatically Detect Settings” checkbox.
5. Check the “Use a proxy server for your LAN (These settings will not apply to dial-up or VPN connections).” checkbox.
6. Enter the address “172.16.3.150” in the “Address” text field and “80” in the “Port” text field.
7. Check the “Bypass proxy server for local addresses” check box.
8. Click “OK”, and “OK” again.
9. Open “Internet Explorer” and navigate to “http://aihdownload.adobe.com/bin/install_flashplayer11x64ax_gtbd_aih.exe”
and open the file.那么,是否有可能在脚本中实现这一切呢?我想使用这在GPO运行在所有客户端台式机。
我很感谢你提供的任何帮助!非常感谢!
发布于 2011-10-29 19:27:14
您不需要IE和它的gui在代理服务器后面发出http请求。您可以使用WinHttpRequest对象下载文件(包含代理信息,请参阅SetProxy)。
(例如)
Const HTTPREQUEST_PROXYSETTING_PROXY = 2
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Dim oHttp
Set oHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
With oHttp
'Make request
.SetTimeouts 5000,5000,5000,30000
.SetProxy HTTPREQUEST_PROXYSETTING_PROXY, "172.16.3.150:80"
.Open "GET", "http://aihdownload.adobe.com/bin/install_flashplayer11x64ax_gtbd_aih.exe", False
.Send
If oHttp.Status = 200 Then
'Save Response
With CreateObject("ADODB.Stream")
.Open
.Type = adTypeBinary
.Write oHttp.ResponseBody
.SaveToFile "C:\setup.exe", adSaveCreateOverWrite
.Close
End With
'Run Executable
CreateObject("WScript.Shell").Run "C:\setup.exe"
WScript.Echo "Completed!"
Else
WScript.Echo "Download Failed"
End If
End With
Set oHttp = Nothinghttps://stackoverflow.com/questions/7940669
复制相似问题