List files in folders on my NAS server
brucine Posted messages 25279 Registration date Status Member Last intervention -
Hello,
I have a Synology NAS server on which I have several folders, and I would like to list their contents in order to have a "catalog" of each file. In a way, a searchable list of all the files in each folder, in txt format.
I had managed to do this a long time ago by finding a method online, but I can't seem to find it again now, and I'm stuck. I got lucky back then; it seems my luck has run out.
Could a kind soul please help me?
Thank you very much in advance.
5 answers
-
Hello,
I assume you have one or more network drives pointing to your NAS.
If not, add a network drive that points to the root of your shares, then the list of files can be created using a basic script, for example :
dir /b /s Z: > "%USERPROFILE%\Desktop\list.txt"
ps: don't forget to replace the letter Z with your drive letter.
-
-
Here is a tutorial for adding a network drive:
https://www.varcap-informatique.net/tutoriels/comment-connecter-un-lecteur-reseau-sur-windows-10/
-
-
Thank you, I will try that tonight.
-
It's all set, I assigned him the letter Z (just for your info).
I messed up a bit because I typed too fast, but I managed to do it by concentrating a little.
How do I create a list of the files in each folder in list.text format, please?-
Hello,
If a letter has been assigned, we don't need to specify the UNC path and if there are no files at the root, that should be enough:
dir Z:\ /o /s /b /a-d >> "C:\Users\brucine\Desktop\liste.txt"
If I want to summarize by folder and subfolder (including any files at the root), there are several ways to proceed, the simplest is to replace the DIR command with TREE /F
-
-
Nothing is working.
Yet, I had managed it and now, I can't do it anymore.
And I didn't have to assign a letter or create a network drive back then.-
But what else?
If a NET USE command has been used to assign a letter to this NAS and it is persistent or via a graphical interface as recalled in <3>, we should have access through this letter; we can explore this NAS on the local network without it, but certainly cannot execute DOS commands on it without having done anything first: we either address it through this drive letter or through the UNC path in the format \\NAS\folder where NAS refers to the IP of the NAS or its network name.
We also need to ensure that we have administrative rights or not.
-
