本帖最后由 _ddqs. 于 2010-10-28 01:57 编辑 ;XP-SP3测试(操作畸形不件夹)(打开或删除)
#include <Constants.au3>
#include<process.au3>
$_weizi = 'f:\'
$_filename = '爱 什么 是什么........'
DirCreate($_weizi & $_filename & './')
$_filename = ' 爱 什么 是什么........'
DirCreate($_weizi & $_filename & './')
$GetShortName=@TempDir&"\GetShortName.txt"
$foo = RunWait(@ComSpec & " /c dir/x/n "&$_weizi& " |find /i /n "&' "'&$_filename&'">"'&$GetShortName&'"', @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
$i=1
While 1
$line = FileReadLine($GetShortName,$i)
If $line="" Then ExitLoop
$line = StringReplace($line,1,"****************************************")
$line = StringReplace($line,"*","")
$line = StringReplace($line," ","|")
;MsgBox(0,"",$line)
$filename = StringSplit($line,"|")
$YES = MsgBox(262144+292,"警告","文件名:"&$filename[2]&@CR&"的短文件为:"&$filename[1] &@CRLF&@CR&@CR&"你将要其删除吗?")
If $YES="YES" Or $YES=6 Then ;MsgBox(0,"",'"'& $_weizi & $filename[1] &'"')
_RunDOS('rd /s /q "'& $_weizi & $filename[1] &'."')
Else
_RunDOS('start "" "'& $_weizi & $filename[1] &'."') ;ShellExecute('"'& $_weizi & $filename[1] &'."')
EndIf
$i+=1
WEnd
If FileExists($GetShortName) Then FileDelete($GetShortName)
|