I am wanting to use the command line to output a list of file names to a CSV, but the files are on a network drive.
On my computer I have a folder of movies on my D: drive. By changing the directory in command line and using dir /b > Movies.csv
I can obtain a list of all movie titles in that directory. However, we now have a WD NAS box with all of our movies in it and I would like to somehow use command line to pull an updated csv of movie names from it. Since it's no longer on one of my drives in my computer, I am unsure of how to do this.
Assuming you are talking about windows because you speak of a "D:" drive. You can do the following:
net use X: \\NAS\Share
This will "mount" the \NAS\Share folder to drive "X". Because it is now a drive you can just use regular commands to "cd" to it and then "dir /b > file.csv"
You can also look at https://superuser.com/a/52237/286811 if you do not want a permanent mounted drive.
Even better, I just found out this is also possible
dir /b \\NAS\share
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With