'建议你增加个判断文件是否存的的语句 if dir("D:\应用软件\kabenruanjian\新建文件夹\新建文件夹\aaa.xls",vbDirectory)<>"" then '文件名你可能改 '文件存在 else '文件不存在 end if
'建议你增加个判断文件是否存的的语句 if dir("D:\应用软件\kabenruanjian\新建文件夹\新建文件夹\",vbDirectory)<>"" then '文件夹名你可能改,注意最后一个一定要是 \ 有这个表示文件夹,没有表示文件 '文件存在 else '文件不存在 end if
if dir("c:\test.exe",vbNormal or vbHidden or vbReadOnly or vbSystem )<>"" then on error resume next setattr "c:\test.exe",vbnormal kill "c:\test.exe" end if
'建议你增加个判断文件是否存的的语句
if dir("D:\应用软件\kabenruanjian\新建文件夹\新建文件夹\aaa.xls",vbDirectory)<>"" then '文件名你可能改
'文件存在
else
'文件不存在
end if
'建议你增加个判断文件是否存的的语句
if dir("D:\应用软件\kabenruanjian\新建文件夹\新建文件夹\",vbDirectory)<>"" then '文件夹名你可能改,注意最后一个一定要是 \ 有这个表示文件夹,没有表示文件
'文件存在
else
'文件不存在
end if
on error resume next
setattr "c:\test.exe",vbnormal
kill "c:\test.exe"
end if
Kill "要删除的文件"