本帖最后由 朱雅琼 于 2010-1-13 01:19 编辑
早的话再帮我改下这个吧
我想批量把目录和子目录*.txt 改成*.bak这样的While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ok
$txt=GUICtrlRead($Input1)
$bak=GUICtrlRead($Input2)
$path=@ScriptDir
_filelist($path,$txt,$bak)
EndSwitch
WEnd
Func _filelist($searchdir,$ren,$rened)
$search = FileFindFirstFile($searchdir & "\*.*")
If $search = -1 Then Return -1
While 1
$file = FileFindNextFile($search)
If @error Then
FileClose($search)
Return
ElseIf $file = "." Or $file = ".." Then
ContinueLoop
ElseIf StringInStr(FileGetAttrib($searchdir & "" & $file), "D") Then
_filelist($searchdir & "" & $file,$ren,$rend)
EndIf
_RunDOS('ren ' & $path &'\*.' & $ren &' ' & '*.' & $rened)
WEnd
EndFunc
这样会显示声明啊 |