looking for Script whch shows all MP3 file in txt frm system

September 17, 2012 at 20:45:04
Specs: Windows 7
so far i have tried this code but its not working ...can anyone pls suggest me ...

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_DataFile where Extension = 'mp3'")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\mp3list\mp3.txt", 8, True)
For Each objFile in colFiles
'Wscript.Echo objFile.Name

objFile.WriteLine " objFile.Name "

Next

objFile.Close


See More: looking for Script whch shows all MP3 file in txt frm system

Report •

#1
September 17, 2012 at 21:23:47
just guessing...not tested.
...
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set outfile = objFSO.OpenTextFile("c:\mp3list\mp3.txt", 8, True)
For Each File in colFiles
outfile.WriteLine File.Name
Next
outfile.Close

Report •
Related Solutions


Ask Question