首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用VB脚本进行闪存安装

使用VB脚本进行闪存安装
EN

Stack Overflow用户
提问于 2011-10-29 17:56:51
回答 1查看 908关注 0票数 0

编剧,

我是新的VB脚本世界!

我想通过脚本来完成以下工作,这样我就可以安装Flash了。

步骤如下:

代码语言:javascript
复制
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运行在所有客户端台式机。

我很感谢你提供的任何帮助!非常感谢!

EN

回答 1

Stack Overflow用户

发布于 2011-10-29 19:27:14

您不需要IE和它的gui在代理服务器后面发出http请求。您可以使用WinHttpRequest对象下载文件(包含代理信息,请参阅SetProxy)。

(例如)

代码语言:javascript
复制
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 = Nothing
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7940669

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档