• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1331
  • Last Modified:

Need a script to scan computers for mp3 files and generate a list

I need a script to scan a list of computers (that are part of an OU in a domain) for mp3 (or other audio and video) files and generate a list.
0
Ehab Salem
Asked:
Ehab Salem
2 Solutions
 
michkoCommented:
I don't have script to do that, but here is a program that will do what you're asking:
http://www.tucows.com/preview/251416

Hope that helps.
0
 
sungenwangCommented:
The sample vbscript below will read from a file (C:\Computers.txt) and search all the "mp3" & "wma" files in C: drive, then output to a log file (C:\Files.log).

This will take some time to run.
sew

strComputerList = "C:\Computers.txt"
strFileList = "C:\Files.log"
 
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
 
arrComputers = Split(objFSO.OpenTextFile(strComputerList).ReadAll, vbCrLf)
 
For Each strComputer in arrComputers
	Dim objOut : Set objOut = objFSO.CreateTextFile (strFileList)
	Dim objWMI : Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
	Dim colFiles : Set colFiles = objWMI.ExecQuery ("Select * from CIM_Datafile Where Drive = 'C:' And (Extension = 'mp3' OR Extension = 'wma')")

	For Each objFile in colFiles
		objOut.WriteLine strComputer & ": " & objFile.Name
	Next

	objOut.Close
	Set objOut = Nothing
	Set colFiles = Nothing  
	Set objWMI = Nothing
Next
 
Set objFSO = Nothing
msgbox "done!"

Open in new window

0
 
Danny ChildIT ManagerCommented:
Dir *.mp3 /s > c:\mp3list.txt
0
 
Ehab SalemAuthor Commented:
Thank you.
Although Mitchko solution is great I cannot use it for 2 reasons:
1- The domain contains hundreds of computers and the list is (for me) more practical.
2- I am not allowed to install freeware.
0
 
michkoCommented:
I'm glad you got what you needed - and thank you for the assist.
Best of luck to you.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now