vbs常用函数

aa

 

'删除文件夹
sub DeleteFolder(objFolder)
    call OutputLog(objFolder.Path,true)
    err.Clear
    On Error Resume Next
    objFolder.attributes=0
    objFolder.delete
    On Error Goto 0
    if Err.Number then
        Msgbox "删除文件夹[" & objFolder.Path & "]失败" & vbcrlf & Err.Description
    end if
end sub

 

'删除文件
sub DeleteFile(objFile)
    'call OutputLog(objFile.Path,false)
    err.Clear
    On Error Resume Next
    objFile.attributes=0
    objFile.delete
    On Error Goto 0
    if Err.Number then
        Msgbox "删除文件[" & objFolder.Path & "]失败" & vbcrlf & Err.Description
    end if
end sub

 

posted @ 2018-08-30 22:35  eATM  阅读(463)  评论(0编辑  收藏  举报