求双击vbs脚本就将U盘文件夹复制到C盘
发布网友
发布时间:2023-12-24 09:06
我来回答
共1个回答
热心网友
时间:2024-07-21 05:51
'验证通过
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