找不到可以安装的文件就会提示出错!
$FileList = _FileListToArray(@ScriptDir & "\SoftWare", "*.*", 1)If @error = 1 Then
GUICtrlSetData($Edit2, "找不到文件夹,可能路径出错,请检查!" & @CRLF & @CRLF, 1)
Sleep(1000)
EndIf
If @error = 4 Then
GUICtrlSetData($Edit2, "未发现可安装程序!" & @CRLF & @CRLF, 1)
Sleep(1000)
EndIf
GUICtrlSetData($Edit2, "已发现" & $FileList & "个可安装程序,马上进入安装..." & @CRLF & @CRLF, 1)
Sleep(1000)
For $i = 1 To $FileList
GUICtrlSetData($Edit2, "正在安装 " & $FileList[$i], 1)
RunWait(@ScriptDir & "\SoftWare\" & $FileList[$i])
Sleep(300)
GUICtrlSetData($Edit2, " √ " & @CRLF & @CRLF, 1)
Next如果安装目录下面有文件,就一切都很正常.但是如果没有文件,找不到可以安装的文件就会提示出错!
大伙帮忙看看... $FileList = _FileListToArray(@ScriptDir & "\SoftWare", "*.*", 1)
If @error = 1 Then
GUICtrlSetData($Edit2, "找不到文件夹,可能路径出错,请检查!" & @CRLF & @CRLF, 1)
Sleep(1000)
elseIf @error = 4 Then
GUICtrlSetData($Edit2, "未发现可安装程序!" & @CRLF & @CRLF, 1)
Sleep(1000)
else
GUICtrlSetData($Edit2, "已发现" & $FileList & "个可安装程序,马上进入安装..." & @CRLF & @CRLF, 1)
Sleep(1000)
For $i = 1 To $FileList
GUICtrlSetData($Edit2, "正在安装 " & $FileList[$i], 1)
RunWait(@ScriptDir & "\SoftWare\" & $FileList[$i])
Sleep(300)
GUICtrlSetData($Edit2, " √ " & @CRLF & @CRLF, 1)
Next
endif 谢谢。。{:face (197):} {:face (404):}把标题改为【已解决】
页:
[1]