|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Concatenation in batch filesHi.
Maybe my question will be stupid, but I am trying to concatenate some strings in a list without success. My batch file has a loop through all the files of a folder: FOR %%a in (C:\Images\*.jpg) I need to create a variable that stores the returned filenames separated by an space, this way: Image1.jpg Image2.jpg Image3.jpg After that I will pass this variable as an argument to an executable. How can I do that kind of concatenation? Thanks, Robert Scheer Robert Scheer wrote:
Show quoteHide quote > Hi. This should do it> > Maybe my question will be stupid, but I am trying to concatenate some > strings in a list without success. My batch file has a loop through all > the files of a folder: > > FOR %%a in (C:\Images\*.jpg) > > I need to create a variable that stores the returned filenames > separated by an space, this way: > Image1.jpg Image2.jpg Image3.jpg > > After that I will pass this variable as an argument to an executable. > > How can I do that kind of concatenation? > ---------------------------- @echo off pushd C:\Images for /f "delims==" %%i in ('dir /b *.jpg') do call :Loop "%%i" rem Note the quotes at end of previous line in case the filenames rem have spaces in them. goto :EchoResults :Loop Set FileList=%FileList% %1GoTo :EOF :EchoResults echo %FileList%popd -------------------------- Note the use of
HELP: lost partition....
Using jpg's as background using LOGON.SCR to change pw system lockup how to shut down OS after 30 Minutes without useractivity Programs will not install Keyboard switching to US Bad network drives Can't disable password never expired on windows 2000 server. QUERY: WinXP Wireless Network Connection tool for Win2000... woes :S |
|||||||||||||||||||||||