如何让这个IE跳转只跳转一次?
While 1Sleep(400)
$oShell = ObjCreate('shell.application')
$oShellWindows = $oShell.windows
For $Window In $oShellWindows
If StringRight($Window.FullName, 12) = 'iexplore.exe' Then
If StringInStr($Window.locationurl,'www.baidu.com',2) Then $Window.navigate('http://www.google.com')
EndIf
Next
WEnd代码执行后监控IE地址栏,第一次打开百度后跳转到谷哥,第二次在打开百度后就不跳转了。直到第二次打开ie后在接着执行 回复 1# angelink
试试这个$a = 0
While 1
Sleep(400)
$oShell = ObjCreate('shell.application')
$oShellWindows = $oShell.windows
If $a = 0 And ProcessExists("iexplore.exe") Then
For $Window In $oShellWindows
If StringInStr($Window.locationurl, 'www.baidu.com', 2) Then
$Window.navigate('http://www.google.com')
$a = 1
EndIf
Next
ElseIf $a = 1 And ProcessExists("iexplore.exe") Then
ContinueLoop
Else
$a = 0
ContinueLoop
EndIf
WEnd 回复 2# lixiaolong
谢谢提供,这个很好。 想法不错。
页:
[1]