用createdirectory创建文件夹。(原创)
private sub command1_click()
private declare function createdirectory lib "kernel32" alias "createdirectorya" (byval lppathname as string, lpsecurityattributes as security_attributes) as long
dim attribut as security_attributes
attribut.nlength = len(attribut)
attribut.lpsecuritydescriptor = &o0
attribut.binherithandle = false
dim counter as long
dim tnew as string
dim onew as string
dim i as long
dim lnew as long
dim tx as string
dim mi as string
dim minstra as long
dim a as string
a = inputbox("请输入要创建的文件夹名", "创建文件夹名")
counter = 0
if right(a, 1) <> "\" then
a = a & "\"
end if
lnew = len(a)
for i = 1 to lnew
tx = left(a, i)
if len(tx) > 3 then
mi = right(tx, 1)
if mi = "\" then
call createdirectory(tx, attribut)
end if
end if
next i
end sub