求双击vbs脚本就将U盘文件夹复制到C盘
具体要求vbs脚本就是将U盘(盘符不定)内的名为111的文件夹复制到C盘222这个文件夹中来,本人菜鸟望从头至尾要详细,望好心人多帮帮我的忙,谢谢你了!!...
具体要求vbs脚本就是将U盘(盘符不定)内的名为111的文件夹复制到C盘222这个文件夹中来,本人菜鸟望从头至尾要详细,望好心人多帮帮我的忙,谢谢你了!!
展开
展开全部
'验证通过
strFolder = "111" 'U盘路径
strCFolder = "C:\" 'C盘路径
bOverWrite = True '是否覆盖
set fso = createObject("scripting.fileSystemObject")
Set dsks = fso.Drives
For Each f0 In dsks
If(f0.IsReady And f0.DriveType = 1) Then
strUFolder = CStr(f0.DriveLetter) & ":\" & strFolder
End If
Next
If(Not Fso.FolderExists(strUFolder)) Then
MsgBox "目标不存在"
WScript.quit
End If
MsgBox strUfolder
Set fld = fso.GetFolder(strUFolder)
Call fld.Copy(strCFolder&strFolder, bOverWrite)
fso = Null
fld = Null
strFolder = "111" 'U盘路径
strCFolder = "C:\" 'C盘路径
bOverWrite = True '是否覆盖
set fso = createObject("scripting.fileSystemObject")
Set dsks = fso.Drives
For Each f0 In dsks
If(f0.IsReady And f0.DriveType = 1) Then
strUFolder = CStr(f0.DriveLetter) & ":\" & strFolder
End If
Next
If(Not Fso.FolderExists(strUFolder)) Then
MsgBox "目标不存在"
WScript.quit
End If
MsgBox strUfolder
Set fld = fso.GetFolder(strUFolder)
Call fld.Copy(strCFolder&strFolder, bOverWrite)
fso = Null
fld = Null
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询