2

expect to open a link in internet explorer and refresh it automatically every 5 seconds but it can not open after try

powershell with administrator

Set-ExecutionPolicy remotesigned

powershell script

On Error Resume Next

Set objExplorer = CreateObject("InternetExplorer.Application")

objExplorer.Navigate "http://www.google.com"   
objExplorer.Visible = 1

Wscript.Sleep 5000

Set objDoc = objExplorer.Document

Do While True
    Wscript.Sleep 5000
    objDoc.Location.Reload(True)
    If Err <> 0 Then
        Wscript.Quit
    End If
Loop
  • That is WSH, not Powershell. – Kevin Panko Oct 5 '14 at 15:50
1

The command

Set-ExecutionPolicy remotesigned

Is a PowerShell command, but the script is VBScript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.