Create a list from hard drive

Microsoft Windows
Post Reply
User avatar
MigrationUser
Posts: 336
Joined: 2021-Jul-12, 1:37 pm
Contact:

Create a list from hard drive

Post by MigrationUser »

26 Nov 2013 09:54
karaokeguy777

i have a ton of karaoke songs on my f: i dont know where i messed up at. i want it to give me a text file that i can copy to a spreadsheet heres what i have

Code: Select all

@echo off
for /f "tokens=*" %%a in ('dir *.mp3 /b /a-d') do echo %%~na>>0All7.txt
exit

should be simple right...

----------------------------

#2 26 Nov 2013 10:24
foxidrive

Code: Select all

dir \*.mp3 /b /s /a-d >file.txt
----------------------------

#3 26 Nov 2013 17:47
karaokeguy777

Code: Select all

@echo off
for /f "tokens=*" %%a in ('dir *.mp3 /b /s /a-d) >0All7.txt
exit
it still didnt work

----------------------------

#4 26 Nov 2013 19:56
AiroNG

you do not need "for /f ......"
just:

Code: Select all

@echo off
dir \*.mp3 /b /s /a-d >0all7.txt
and there you have your list

I don't suffer from insanity, I enjoy every minute of it.

----------------------------

#5 26 Nov 2013 20:55
karaokeguy777


thank you it worked but i dont need the drive letter in there i wanted it to come out like this

10 Years - Through The Iris
10 Years - Wasteland
10,000 Maniacs - Because The Night

so back to the drawing board for me

----------------------------

#6 26 Nov 2013 21:09
karaokeguy777


i also realized it did all my music files not just karaoke.... hmmm how do i get it to exclude those and scan for zips too. its been way to long for me ....lol

----------------------------

#7 26 Nov 2013 21:39
AiroNG


This will get rid of everything but the title:

Code: Select all

for /f "delims=" %%a in ('dir /s /b *.mp3') do @echo %%~na
for "scan for zips too":

Code: Select all

dir *.mp3 *.zip *.rar *.7z (etc.)
do your karaoke files have different file extensions? (example: audiofiles can be .mp3, .wav, .mid, etc...)
If they have the same file extensions: i don't see a way. maybe the filesize could help, but i'm not so sure 'bout that.

I don't suffer from insanity, I enjoy every minute of it.

----------------------------

#8 26 Nov 2013 22:14
karaokeguy777


ok so how do i omit it searching in files like f:music and f:freestyle cause that where all the regular music is at

----------------------------

#9 26 Nov 2013 22:41
AiroNG

Code: Select all

dir /b /s *.* | findstr /v "\folder1" | findstr /v "\folder2 | findstr /v "folder3" | and so on...
Last edited by AiroNG (26 Nov 2013 22:43)

I don't suffer from insanity, I enjoy every minute of it.

----------------------------

#10 26 Nov 2013 23:03
karaokeguy777


so folder 1 and folder 2 would be the music files or karaoke files?

----------------------------

#11 26 Nov 2013 23:16
karaokeguy777


ok the karaoke files are .cdg .... need to do the zips too.... all to 0All07.txt

----------------------------

#12 26 Nov 2013 23:29
karaokeguy777


no need to omit cause the .cdg is the karaoke so i just need to search the .cdg and all the zips

----------------------------

#13 27 Nov 2013 01:05
AiroNG


By now you have every necessary piece of information to make a working batch-script.

You've been given...
  • ...a way to only list the name of a file ( for /f "delims=" %%a in ('dir /s /b *.mp3') do @echo %%~na ).
  • ...a way to list multiple extension ( dir *.mp3 *.zip *.rar *.7z (etc.) ).
  • ...a way to list every searched-for item in a single file ( dir \*.mp3 /b /s /a-d >0all7.txt ).
Try to combine them...

In all fairness, and without wanting to be overly rude:
I won't write your code for you, and i don't think anyone else will.
You have every bit of information to work out a working script by yourself.
Go trial and error. This way you'll learn. If someone would write the code
for you and you just copy&paste it, there would be no real learning effect.

I don't suffer from insanity, I enjoy every minute of it.

----------------------------

#14 27 Nov 2013 10:47
karaokeguy777


i got it thanks yalll for all the help....
Post Reply