AutoIt - 在没有 #RequireAdmin 的情况下打开 url 时崩溃
AutoIt - Crash without #RequireAdmin for opening a url
如果我 运行 在 test.au3 中:
#requireadmin
#include<IE.au3>
$oIE = _IECreate("www.google.com", 0, 1, 0, 1)
它成功打开了一个新的 Internet Explorer window 并导航到 www.google.com。
现在,如果我删除#requireadmin 和 运行:
#include<IE.au3>
$oIE = _IECreate("www.google.com", 0, 1, 0, 1)
它只会打开 window 而不会导航到 URL。大约 15 秒后它崩溃了:
---------------------------
AutoIt Error
---------------------------
Line 272 (File "\intra.saaq.net\sb\du\du02\gar25\Desktop\outil_outlook\sources\Include\IE.au3"):
$oObject.navigate($sUrl)
$oObject^ ERROR
Error: The requested action with this object has failed.
---------------------------
OK
---------------------------
为什么需要 #requireadmin 才能简单地导航到 URL?
有什么解决办法吗?
使用 AutoIt3.exe - 3.3.14.0
这似乎是一个 Windows 安全问题。
The AutoIt help for _IECreate()
描述了一些解决方法; #RequireAdmin
是其中之一...
New security in Windows Vista causes a new browser window to be
created when a browser is instructed to navigate to a URL in a
different security zone.
This occurs as well with the initial creation and navigation initiated
with _IECreate().
The new window is a new browser instance and the previous browser
object variable no longer points to it.
There are several workarounds:
1) add #RequireAdmin to your code (this is required even if the
account is part of the Administrator's Group and will prompt for
credentials if necessary),
2) use _IEAttach() to connect to the new browser window
3) add the target website to the Trusted Sites security zone in IE,
4) turn off "Protected Mode" in IE,
or 5) disable UAC. Care must be taken to understand the implications
of disabling IE security features when accessing untrusted sites.
如果我 运行 在 test.au3 中:
#requireadmin
#include<IE.au3>
$oIE = _IECreate("www.google.com", 0, 1, 0, 1)
它成功打开了一个新的 Internet Explorer window 并导航到 www.google.com。
现在,如果我删除#requireadmin 和 运行:
#include<IE.au3>
$oIE = _IECreate("www.google.com", 0, 1, 0, 1)
它只会打开 window 而不会导航到 URL。大约 15 秒后它崩溃了:
---------------------------
AutoIt Error
---------------------------
Line 272 (File "\intra.saaq.net\sb\du\du02\gar25\Desktop\outil_outlook\sources\Include\IE.au3"):
$oObject.navigate($sUrl)
$oObject^ ERROR
Error: The requested action with this object has failed.
---------------------------
OK
---------------------------
为什么需要 #requireadmin 才能简单地导航到 URL? 有什么解决办法吗?
使用 AutoIt3.exe - 3.3.14.0
这似乎是一个 Windows 安全问题。
The AutoIt help for _IECreate()
描述了一些解决方法; #RequireAdmin
是其中之一...
New security in Windows Vista causes a new browser window to be created when a browser is instructed to navigate to a URL in a different security zone.
This occurs as well with the initial creation and navigation initiated with _IECreate().
The new window is a new browser instance and the previous browser object variable no longer points to it.
There are several workarounds:
1) add #RequireAdmin to your code (this is required even if the account is part of the Administrator's Group and will prompt for credentials if necessary),
2) use _IEAttach() to connect to the new browser window
3) add the target website to the Trusted Sites security zone in IE,
4) turn off "Protected Mode" in IE,
or 5) disable UAC. Care must be taken to understand the implications of disabling IE security features when accessing untrusted sites.