vb創建文件夾
❶ vb中如何新建文件夾和復制文件夾啊(包括裡面的文件)
Sub 文件夾()
Dim fs As FileSystemObject
Dim fd As Folder
Dim f1 As File
Dim f2 As File
Dim a As Boolean
Set fs = CreateObject("Scripting.FileSystemObject")
a = fs.FolderExists("E:\文件夾\123")
If a Then
Set fd = fs.GetFolder("E:\文件夾\123")
For Each f1 In fd.Files
If LCase(Right(f1.Name, 4)) = ".ini" Then
f1.Delete True
End If
Set f2 = fs.GetFile("D:\內容\aa.ini")
f2.Copy "E:\文件夾\123\", True
Next
Else
Set fd = fs.CreateFolder("E:\文件夾\123")
Set f2 = fs.GetFile("D:\內容\aa.ini")
f2.Copy "E:\文件夾\123", True
End If
End Sub
❷ VB怎麼才能在某個地方生成一個文件或文件夾
'vb有mkdir的,他隸屬filesystem,功能是創建一個文件夾及目錄
dim
fixx
fixx
=
"c:\"
&
replace(now,
":",
".",
,
,
vbtextcompare)
mkdir
fixx
'
在c盤根目錄下生成以年月日時分秒為文件名的文件夾
'我試過了,可以的!
❸ 怎樣用VB創建文件夾