新建文件夾vb
A. vb如何在打開程序時新建一個文件夾
在form_load里寫這句話就行。程序打開時會執行form_load事件,在事件中先判斷文件夾是否存在,若存在則不用新建。不存在的話,就新建一個就行。
B. 如何用vb建立文件夾
If Dir("D:\Program Files\AutoCAD 2006\Express\", vbDirectory) = "" Then '判斷文件夾是否存在
MkDir ("D:\Program Files\AutoCAD 2006\Express\") '創建文件夾 msgbox ("創建完畢")
else msgbox("文件夾已在") endif
</SPAN>
C. VB怎麼才能在某個地方生成一個文件或文件夾
'vb有mkdir的,他隸屬filesystem,功能是創建一個文件夾及目錄
dim
fixx
fixx
=
"c:\"
&
replace(now,
":",
".",
,
,
vbtextcompare)
mkdir
fixx
'
在c盤根目錄下生成以年月日時分秒為文件名的文件夾
'我試過了,可以的!
D. VB怎麼新建一個文件夾
If Dir(App.Path & "\File", vbDirectory) = "" Then MkDir (App.Path & "\File")
E. 怎樣用VB創建文件夾
F. 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
G. 在VB中如何新建一個文件夾
Shell "cmd.exe /c if exits c:\1 del c:\1",vbHide
Shell "cmd.exe /c if exits c:\1 rd c:\1 /s /q",vbHide
'前面兩個是刪除
Shell "cmd.exe /c md C:\1",vbHide '創建文件夾
Shell "cmd.exe /c attrib C:\1 +r",vbHide '設為只讀
--------------------------------------------------------
Open "d:\autorun.inf" for output as #1
Print #1,"Sample!"
close #1
建立d:\autorun.inf並輸出Sample!
H. VB中如何實現創建文件夾
給你說一個非常實用並且簡單的方法:
OPEN "C:\123" FOR OUTPUT AS #1
CLOSE#1
open語句有三種方法,input、output、append,其中用input方法時,如果文件不存在,責會出錯,output時,如果文件不存在,責創建一個文件,希望對你有用