Using VB6
I have the text file with different sizes, so i开发者_高级运维 want to delete the file where filesize = 0 kb.
How to make a vb6 code for deleting the 0 kb files.
Need vb6 code Help
You can use the FileLen function to check the file size.
You can use the FileLen function. See here: http://www.vbforums.com/showthread.php?t=498720
Try this function:
Sub DeleteZeroLengthFile(ByRef sFilePath As String)
' Inputs: sFilePath Filename or path name of file to be tested.
' Outputs: <None>
' In/Outs: <None>
' Errors: Will raise error if file doesn't exist, is inaccessible, is locked, or user
' doesn't have permissions.
If FileLen(sFilePath) = 0 Then
Kill sFilePath
End If
End Sub
精彩评论