Compile A List of Text, Help

May 10, 2009 at 23:25:11
Specs: Microsoft Windows Vista Business, 2.2 GHz / 3582 MB
I am trying to make a batch file that will put series of code into a text file (which will be a batch file)

I am having issues with the %%b (circle red) leaves out a extra '%' %b

Picture Here:
http://img9.imageshack.us/img9/7346...

Song_list2.txt will be a batch file by the way

Does anyone have any idea's why it is doing that?


See More: Compile A List of Text, Help

Report •


#1
May 11, 2009 at 00:51:30
Might help to post the script.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
May 11, 2009 at 00:59:26
Song_Compile.txt

@echo off > Song_List2.txt & setLocal EnableDelayedExpansion

for /f "tokens=* delims=" %%a in (Song_List.txt) do (
echo "for /f "delims=*" %%b in ('dir /b /s "*%%a*"') do del /p /s "%%b"">> Song_List2.txt
)

Song_list.txt

song1.mp3
song2.mp3
song3.mp3
song4.mp3
song5.mp3

Song_list2.txt

"for /f "delims=*" %b in ('dir /b /s "*song1.mp3*"') do del /p /s "%b""
"for /f "delims=*" %b in ('dir /b /s "*song2.mp3*"') do del /p /s "%b""
"for /f "delims=*" %b in ('dir /b /s "*song3.mp3*"') do del /p /s "%b""
"for /f "delims=*" %b in ('dir /b /s "*song4.mp3*"') do del /p /s "%b""
"for /f "delims=*" %b in ('dir /b /s "*song5.mp3*"') do del /p /s "%b""


Where the %b are in Song_list2.txt
It should be %%b not %b
i don't know how to add another % to %b


Report •

#3
May 11, 2009 at 01:26:45
My brain is not working. Probably IVO will show us the way.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions

#4
May 11, 2009 at 01:48:13
To echo % you must double it. Double up on the %% so that you echo %%%%b to give you %%b in the output file.


Report •

#5
May 11, 2009 at 02:19:21
lol, thanks, that was simple :p

Report •


Ask Question