Здравствуйте!
Пытаюсь перевести с VBS на AutoIt и пока безуспешно, подскажите, почему AutoIt зависает на этой строчке:
Исходный код
AutoIt код:
Пытаюсь перевести с VBS на AutoIt и пока безуспешно, подскажите, почему AutoIt зависает на этой строчке:
Код:
$searchResult = $updateSearcher.Search("Type='Software' and IsInstalled=0")
Исходный код
Код:
Dim hideupdates(7)
hideupdates(0) = "Microsoft Security Essentials - KB2267621"
hideupdates(1) = "Microsoft Security Essentials - KB2691894"
hideupdates(2) = "Bing Desktop"
hideupdates(3) = "Windows Internet Explorer 9 for Windows 7"
hideupdates(4) = "Windows Internet Explorer 9 for Windows 7 for x64-based Systems"
hideupdates(5) = "KB971033"
hideupdates(6) = "Update for Windows 7 for x64-based Systems (KB971033)"
hideupdates(7) = "KB2483139"
set updateSession = createObject("Microsoft.Update.Session")
set updateSearcher = updateSession.CreateupdateSearcher()
set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
For i = 0 To searchResult.Updates.Count-1
set update = searchResult.Updates.Item(i)
For j = LBound(hideupdates) To UBound(hideupdates)
if instr(1, update.Title, hideupdates(j), vbTextCompare) > 0 then
Wscript.echo "Hiding " & hideupdates(j)
update.IsHidden = True
end if
Next
Next
AutoIt код:
Код:
#include <Array.au3>
$updateSession = ObjCreate("Microsoft.Update.Session")
$updateSearcher = $updateSession.CreateupdateSearcher()
$searchResult = $updateSearcher.Search("Type='Software' and IsInstalled=0")
$hideupdates1 = "KB2876229"
For $i = 0 To $searchResult.Updates.Count - 1
$update = $searchResult.Updates.Item($i)
If StringInStr($update.Title, $hideupdates1) > 0 Then
msgbox (0, "", "Hiding " & $hideupdates1)
$update.IsHidden = True
EndIf
Next