如何将文件夹的多个文件复制到上一个文件夹中去
c盘有一个a文件夹a文件夹里有b文件夹b文件夹有c文件夹程序在b文件夹如何把c文件夹复制到a文件夹用VB...
c盘有一个a文件夹
a文件夹里有b文件夹
b文件夹有c文件夹
程序在b文件夹
如何把c文件夹复制到a文件夹
用VB 展开
a文件夹里有b文件夹
b文件夹有c文件夹
程序在b文件夹
如何把c文件夹复制到a文件夹
用VB 展开
3个回答
展开全部
还是楼上的简单,我这和那个意思差不多,就是将长文件名转为短文件名
,是没有什么必要,因为我想用shell 命令做着,不过没能成。
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Sub Command1_Click()
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFolder Text1.Text, Text2.Text
End Sub
Private Sub Command2_Click()
Dim path
path = App.path
Text1.Text = path
Dim strShort As String, fname$, l&, fname2$
fname = Text1.Text
strShort = String(LenB(fname), Chr(0))
l& = GetShortPathName(ByVal fname, ByVal strShort, ByVal Len(strShort))
fname2$ = Left(strShort, InStr(strShort, Chr(0)) - 1)
Text1.Text = fname2$ + "\c"
End Sub
Private Sub Command3_Click()
Dim path
Dim jia
Dim jiab
path = App.path
Text2.Text = path
Dim strShort As String, fname$, l&, fname2$
fname = Text2.Text
strShort = String(LenB(fname), Chr(0))
l& = GetShortPathName(ByVal fname, ByVal strShort, ByVal Len(strShort))
fname2$ = Left(strShort, InStr(strShort, Chr(0)) - 1)
Text2.Text = fname2$
jhb = InStrRev(Text2.Text, "\")
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = jhb
jiab = Text2.SelText
Text2.Text = jiab
End Sub
,是没有什么必要,因为我想用shell 命令做着,不过没能成。
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Sub Command1_Click()
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFolder Text1.Text, Text2.Text
End Sub
Private Sub Command2_Click()
Dim path
path = App.path
Text1.Text = path
Dim strShort As String, fname$, l&, fname2$
fname = Text1.Text
strShort = String(LenB(fname), Chr(0))
l& = GetShortPathName(ByVal fname, ByVal strShort, ByVal Len(strShort))
fname2$ = Left(strShort, InStr(strShort, Chr(0)) - 1)
Text1.Text = fname2$ + "\c"
End Sub
Private Sub Command3_Click()
Dim path
Dim jia
Dim jiab
path = App.path
Text2.Text = path
Dim strShort As String, fname$, l&, fname2$
fname = Text2.Text
strShort = String(LenB(fname), Chr(0))
l& = GetShortPathName(ByVal fname, ByVal strShort, ByVal Len(strShort))
fname2$ = Left(strShort, InStr(strShort, Chr(0)) - 1)
Text2.Text = fname2$
jhb = InStrRev(Text2.Text, "\")
Text2.SetFocus
Text2.SelStart = 0
Text2.SelLength = jhb
jiab = Text2.SelText
Text2.Text = jiab
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
lj = Left(App.Path, (InStrRev(App.Path, "\")))
fso.CopyFolder App.Path & "\c", lj
End Sub
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
lj = Left(App.Path, (InStrRev(App.Path, "\")))
fso.CopyFolder App.Path & "\c", lj
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询