Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS switches

Status
Not open for further replies.

dik

Technical User
Jul 18, 2001
217
MD
I didn't know where to put this:

My wife is unable to walk and spends most of her day watching TV. We have over 1000 DVD's/Bluerays and I'm in the process of loading most of them on to an 8TB hard drive so she can access them on her TV. The HD plugs into a USB slot on her TV.

As I add new movies to the HD (Drive I:) in the \movies subdirectory, I use the DOS command and do a directory list to provide me with a file and listing of the movies.

dir I:\movies /b > D:\movies.txt

This lists the movie files in subdirectory movies and prints them to a *.txt file. I then do a <Ctrl><H> for search and replace and replace the extensions with a nul. I then do a <Ctrl><A> and copy the *.txt file to an openoffice document *.doc file so I can format it.

She now has over 500 movies that display alphabetically and it is too difficult to scroll through all the movies to find the one she wants.

When I'm through copying I will load the movies into subdirectories 0-9, A, B, … , X-Y-Z to limit the subdirectories to 25 or so. It makes it a lot simpler to find. I load a copy of her movies to a tablet in a *.pdf format so she can easily select one of the filenames.

By introducing subdirectories, if I now do a directory and direct the output to a filename, I get the 'clutter' from the subdirectories.

Is there a switch or series of switches that I can use to eliminate the additonal subdirectory information.
 
I'm not sure what "clutter" you are referring to, but if you want to show directories only (no files), use
[tt]dir /b /ad[/tt]

And if you want only files and no directories, use
[tt]dir /b /a-d[/tt]

You could also use the /s switch to show include subfolders. For example, when you are done making the subfolders and moving the files, [tt]dir /b /a-d /s[/tt] would give something like:
[tt]I:\movies\0-9\12 Angry Men.mp4
I:\movies\0-9\2001: A Space Odyssey.mp4
I:\movies\a\Alien.mp4[/tt]
etc etc
 
I'd direct it to movies and it appears the output would be 0-9\12_Angry_Men.mp4, etc...

What I'd like to remove automatically is the 0-9 part of the string... I'll see if the a-d does that...

Thanks, Dik
 
Then the code below (lifted from here) might work for you:

[tt]for /f "delims=" %a in ('dir /b /s /a-d') do @echo %~na[/tt]
 
Thanks... I'm waiting while I copy a bunch more dvd's to copy to the 8T drive and will try both approaches for creating a listing. I've never used the /a switch, and wasn't aware it was even there...

Dik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top