1 $file = "adobe安装列表.txt" 2 $regedit1 = "hklm64SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall" 3 $regedit2 = "hklm64SOFTWAREMicrosoftWindowsCurrentVersionUninstall" 4 _Filecreate(@DesktopCommonDir & $file) 5 FileOpen(@DesktopCommonDir & $file, 1) 6 7 $i = 1 8 $flag = True 9 While $flag 10 Local $var = RegEnumKey($regedit1, $i) 11 If $var = -1 Then $flag = False 12 If @error <> 0 Then ExitLoop 13 soft_exists($var) 14 $i = $i + 1 15 WEnd 16 17 Func soft_exists($reg_name) 18 Local $displayname = RegRead($regedit1 & $reg_name, "DisPlayName" ) 19 If StringRegExp($DisPlayName, 'Adobe.*', 0) Then 20 FileWriteLine(@DesktopCommonDir & $file,"【" & $displayname & "】 安装在 " & RegRead($regedit1 & $reg_name, "InstallLocation" )) 21 EndIf 22 EndFunc 23 24 FileClose(@DesktopCommonDir & $file)
以上代码仅检测Adobe相关软件与软件安装位置,如需检测其他软件可自行修改