IT CAMPER
asked on
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\01 E\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.
\\computername\d$\audio\01
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.
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
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
ASKER
canali
How can we alter your script to scan the folders from a remote computer using UNC?
How can we alter your script to scan the folders from a remote computer using UNC?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect!
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