本帖最后由 foboy 于 2010-5-16 08:03 编辑
把我的UDF贡献给你,原文地址及说明见:
http://mengniu.in/a/jishu/2010/0516/82.htmlFunc _find_exe_file($_file_name,$_program_name)
;$_file_name:程序文件名$_program_name:程序名称
Local $_i_reg = 1
Do
$_exe_file = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache", $_i_reg)
$_reg_read_result = @error
$_i_reg += 1
$key_value = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache", $_exe_file)
If StringInStr($_game_file, ""&$_file_name) And StringInStr($key_value, $_program_name) Then
$_game_file = StringReplace($_exe_file, "\", "")
ExitLoop
EndIf
Until $_reg_read_result
If $_reg_read_result Or Not FileExists($_exe_file) Then;读取注册表错误或者文件不存在,本文章来源:猛牛脚本 AUTOIT技术交流 MENGNIU.IN autoit.mengniu.in
$_exe_file = FileOpenDialog("选择游戏路径", "", "应用程序(*.exe)", 16)
If @error Then Return SetError(1, 0, "")
EndIf
Return $_exe_file
EndFunc ;==>_find_game_file
|