Here This Searches For All The WMA Files Then Copy Them To %systemDrive%\MusicTemp
To search For Other File Type Change The RED Text To Change The Location Where The Files Goes Change The Green TextQUOTE
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Act : Set Act = CreateObject("Wscript.shell")
Dim Sd : Sd = Act.ExpandEnvironmentStrings("%systemDrive%")
Dim Name, Path, TheFile , INTA
INTA = 1-1
strComputer = "."
If Not Fso.FolderExists(Sd & "\MusicTemp") Then
Fso.CreateFolder(Sd & "\MusicTemp")
End If
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery("Select * from CIM_DataFile Where Extension = 'wma'")
If colFiles.Count = 0 Then
Act.popup "No File With That Extention Was Found",4,"InValid File Type", 0 + 32
Wscript.Quit
End If
For Each objFile in colFiles
INTA = INTA + 1
Name = Ucase(objFile.FileName & "." & objFile.Extension)
Path = UCase(objFile.Drive & objFile.Path)
TheFile = KbPath & Kbname
Fso.CopyFile(Path & Name), (Sd & "\MusicTemp\" & Name)
Act.Popup "Completed The Copy Of This" & vbCrLf & Path & Name & vbCrLf & "The File Count = " & INTA, 2, "Gsm Copy File", 0 + 32
Next
Act.Popup "Completed Search And Copy" & vbCrLf & "Total Amount Of Files Moved = " & INTA, 5, "Gsm Search And Copy"
Fix A Extra quote I Had in The script