本帖最后由 凌菡 于 2014-1-31 22:41 编辑
local $FilesPath[3] = ["C:\c.txt", "D:\d.mp3", "E:\here3"]
For $i = 0 To UBound($FilesPath) - 1
If FileExists($FilesPath[$i]) Then
MsgBox(4096, $FilesPath[$i], "Exists")
FileSetAttrib($FilesPath,"-RSH")
RunWait(@ComSpec & ' /c ' & 'echo y|cacls.exe ' & $FilesPath[$i] & '/P everyone:F','',@SW_HIDE)
DirRemove($FilesPath)
Else
MsgBox(4096, $FilesPath[$i], "Does NOT exists")
DirCreate($FilesPath)
FileSetAttrib($FilesPath, "+RSH",1)
RunWait(@ComSpec & ' /c ' & 'echo y|cacls.exe ' & $FilesPath[$i] & ' /P everyone:R','',@SW_HIDE)
EndIf
Next
我是想建立一个删除不掉的文件,貌似这样写,更接近要求了,可是,还是能删除掉的啊?接着要怎么写? |