vbs 打开网页

On Error Resume Next
Set WMI = GetObject("Winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set A = WMI.ExecQuery("Select * From Win32_DesktopMonitor")
For Each B in A
    W = B.ScreenWidth
    H = B.ScreenHeight
Next

Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "
http://zhidao.baidu.com "
IE.AddressBar = 0
IE.ToolBar = 0
IE.StatusBar = 0
IE.Visible = 1   'Visible数值0隐藏,1最小化,2新窗口'''''''
IE.Left = (W - 800) / 2
IE.Top = (H - 640) / 2
IE.Width = 800
IE.Height = 640


Set O = IE.Document
Do Until i = 100 '100代表刷新100次 
    i = i + 1
    Wscript.Sleep 1000*60*1 '最后1代表每隔1分钟刷新
    O.Location.Reload(True)
    If Err <> 0 Then
        CreateObject("WScript.Shell").Popup "错误:"& Err.Description ,6,"错误提示",4096+64 :IE.Quit :Wscript.Quit
    End If
Loop
IE.Quit
CreateObject("WScript.Shell").Popup "任务以完成,窗口已关闭",6,"提示",4096+64

你可能感兴趣的:(vbs 打开网页)