’首先要[工程]-[引用] Microsoft Scriptting Runtime
Private Sub Command1_Click() Dim fso As New FileSystemObject If fso.FolderExists("c:abc") Then MsgBox ("文件夾已存在") Else fso.CreateFolder ("c:abc") End If End Sub Private Sub Command2_Click() Dim fso As New FileSystemObject If Not fso.FolderExists("c:abc") Then MsgBox ("文件夾不存在") Else fso.DeleteFolder ("c:abc") End If End Sub |
|