13 lines
360 B
VB.net
13 lines
360 B
VB.net
Function IsDirEmpty(path)
|
|
IsDirEmpty = False
|
|
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
|
Set objFolder = objFSO.GetFolder(path)
|
|
If objFolder.Files.Count = 0 And objFolder.SubFolders.Count = 0 Then
|
|
IsDirEmpty = True
|
|
End If
|
|
End Function
|
|
|
|
'Test
|
|
WScript.StdOut.WriteLine IsDirEmpty("C:\Temp")
|
|
WScript.StdOut.WriteLine IsDirEmpty("C:\Temp\test")
|