Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject")If fso.FolderExists("C:\Test") = False Then MsgBox "文件夹不存在!" Exit Sub End If If fso.GetFolder("C:\Test").Files.Count > 0 Then MsgBox "不为空" End If fso.GetFolder("C:\Test").Delete True --------- www.vicmiao.com 努力就有美好時光!
if Dir(App.Path & "\Record\" & sYear, vbDirectory) = "文件夹名" then msgbox "文件夹存在" else msgbox "文件夹不存在" end if
strFile = Dir("g:\c#1", vbDirectory)
If strFile = "" Then
MsgBox "无"
Else
MsgBox strFile
End If
这个文件夹明明存在
Set fso = CreateObject("Scripting.FileSystemObject")If fso.FolderExists("C:\Test") = False Then
MsgBox "文件夹不存在!"
Exit Sub
End If
If fso.GetFolder("C:\Test").Files.Count > 0 Then
MsgBox "不为空"
End If
fso.GetFolder("C:\Test").Delete True
---------
www.vicmiao.com
努力就有美好時光!
msgbox "文件夹存在"
else
msgbox "文件夹不存在"
end if
这位大哥的!