For /F search for MP3 files on remote servers
Posted on 2011-02-11
Trying to read through a text file to search remote servers(Win2K3/Win2K8) for *.mp3 items and output to txt (CSV would be even better!). The text file is C:\Scripts\Server3.txt. I want to search the D:\Data directories on all servers. What I have so far is returning error "%%a is unexpected at this time":
FOR /F %%a IN (Servers3.txt) DO DIR /s *.mp3 >>C:\Scripts\MP3.txt
From researching, It appears I may need setlocal enableextensions and/or enabledelayedexpansion.
Also unclear whether it is more efficient to have the text file just read server name(server1) or the network path(\\server1\Data).
Thanks : )