Need a script or batch file that checks a folder for files and reports finding

I have over 1000 folders that have 1 subfolder inside them.  I need to run a script or a batch against those folders to check for any files that are located inside of the subfolders and then create a text file with the findings.  So here is an example of a folder location.

\\computername\d$\audio\01E\inbox\

I need to scan the inbox folder to see if there are any files inside of it.  If so, then a text file needs to report what files it found.  I can supply a list of the folder paths, or the scaript (batch) could run in the root of the folders (d:\audio\) of the computer and just scan every folder inside of that root.  Again, it is the inbox folder I am interested in.
murrycAsked:
Who is Participating?
 
canaliConnect With a Mentor Commented:

assuming the remote server name is : audiosrv
assuming that the disk in audiosrv to be searched is : e:\
assuming the remote folder is e:\audio
assuming u have the privileges to connet the share

 
net use Q: \\audiosrv\e$\audio
Q:

echo. >listInboxFiles.txt
for /f %%a in ('dir /b /a:d ') do (
  echo ---file found in %%a\inbox     >>listInboxFiles.txt
  dir  /b %%a\inbox                          >>listInboxFiles.txt
  echo ---end list files in %%a\inbox >>listInboxFiles.txt
 )

Gas
0
 
canaliCommented:


Find all file in d:\audio\*\inbox an d put in listInboxFiles.txt
d:
cd d:\audio\
echo. >listInboxFiles.txt
for /f %%a in ('dir /b /a:d ') do (
  echo ---file found in %%a\inbox     >>listInboxFiles.txt
  dir  /b %%a\inbox                          >>listInboxFiles.txt
  echo ---end list files in %%a\inbox >>listInboxFiles.txt
 )


Gas
0
 
gsgiCommented:
Gas : What is a good reference on batch files like that?

I recently found a bat file script that will find the newest x # of files in a directory but I can't read it.
It uses almost the same syntax as above  for /f %a %a ('dir .... ) do (

thanks,

gsgi
0
 
murrycAuthor Commented:
canali

How can we alter your script to scan the folders from a remote computer using UNC?
0
 
murrycAuthor Commented:
Perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.