-y
c:\test',sw_hide)
没必要去循环删除,速度很慢,直接调用api就行了,如下,直接在usesshellapi之后,调用SHMyDelDirectory去删除你的目录.
function
SHMyDelDirectory(const
Source:
string):
boolean
var
fo:
TSHFILEOPSTRUCT
begin
FillChar(fo,
SizeOf(fo),
0)
with
fo
do
begin
Wnd
:=
0
wFunc
:=
FO_Delete
pFrom
:=
PChar(Source
+
#0)
pTo
:=
#0#0
fFlags
:=
FOF_NOCONFIRMATION
+
FOF_SILENT
end
Result
:=
(SHFileOperation(fo)
=
0)
end
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)