LarrySingleton
asked on
For /F search for MP3 files on remote servers
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 : )
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 : )
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please provide your complete batch script to solve the problem...
ASKER
The batch script I attempted was from Ali listed directly under my question:
for /f %%f in (Servers3.txt) do dir %%f /s /a /b > C:\Scripts\MP3.txt
Servers3.txt just lists Server names.
I'll be glad to post whatever additional information you might need...
for /f %%f in (Servers3.txt) do dir %%f /s /a /b > C:\Scripts\MP3.txt
Servers3.txt just lists Server names.
I'll be glad to post whatever additional information you might need...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am increasing points and accepting all solutions as Ali provided initial help, but didn't respond to error, Thommy explained the error,but also billprew went on to do the export to CSV. I am dividing points to Ali, Thommy and billbrew 75/125/125
Thanks to all for your help.
Thanks to all for your help.
ASKER