- for each item in GetObject("winmgmts:").ExecQuery("Select * from Win32_LogicalDisk where DriveType=3")
- dr = item.name
- next
-
- backupFolder = dr & "\备份"
- Set fso = CreateObject("Scripting.FileSystemObject")
- fso.DeleteFile dr & "\cloud\1\*.rar", true
- if not fso.FolderExists(backupFolder) then fso.CreateFolder backupFolder
- fso.MoveFile dr & "\cloud\1\*", backupFolder
- fso.DeleteFolder dr & "\cloud\1", true
- moveRAR dr & "\cloud"
- fso.DeleteFolder dr & "\cloud", true
-
- function moveRAR(fo)
- fso.MoveFile fo & "\*.rar", backupFolder
- for each ofolder in fso.GetFolder(fo).SubFolders
- moveRAR ofolder.path
- next
- end function
复制代码 如果是把vbs放在U盘运行,没必要获取U盘盘符,可以使用相对路径。即将代码中的dr(dr &)去掉。 |