zoukankan      html  css  js  c++  java
  • AutoIt:获取计算机已安装程序列表

    $file = FileOpen(@ScriptDir&"RegInstalledItems.csv",1)
    if $file = -1 Then
    	ConsoleWrite("ERROR: Unable to write to the output file")
    	Exit
    EndIf
    
    $i = 1
    While not @error
    	$var = RegEnumKey("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall", $i)
    	If @error <> 0 then ExitLoop
    	;MsgBox(4096, "SubKey #" & $i & " under HKLMSoftware: ", $var)
    	$var2 = RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall"&$var,"DisplayName")
    	;MsgBox(0,"Val",$var2)
    	$outLine = $var&","&$var2
    	FileWriteLine($file,$outLine)
    	$i += 1
    WEnd
    FileClose($file)
    

      

    在使用autoIt的过程中,无论是自动化测试,还是界面开发,经常性的会需要获取已安装程序列表,从而判断某程序是否已经安装。

    下面提供一个可以运行的代码段(Google获取的)

  • 相关阅读:
    JS和Jquery获取this
    写SQL经验积累2
    转载学习
    java开发3个月总结
    学习规划
    Spring Boot详解
    webSocketDemo
    spring boot中 redis配置类(4.0)
    c语言操作字符串
    聊聊面试常问的HashMap中红黑树
  • 原文地址:https://www.cnblogs.com/autotest/p/3286549.html
Copyright © 2011-2022 走看看