首先要[工程]-[引用] 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

By binbin

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注