This question already has an answer here:
Copying files based on date modified in batch file
(1 answer)
Closed 9 years ago.
Thanks for visiting. My question: I receive daily files that are stored as .csv's, typically with the following format: DEVICE_DEVICENumber_DateID. I'd like to move these files into their respective monthly folders (ie 201401) based on the Date portion of the DateID. The DateID is written as the date first followed by a unique device ID (ex YYYYMMDDUNIQUEID - 2014010110).
If I create folders like the one mentioned above (i.e. 201401, 201402, 201403, etc.), is there a simple way to pull a portion of the string to match the folder that I want to direct the file to?
Thanks for your help!
Calbruin
Typical filename:
GO.YO_WTR_SOO5_PT_20140102110.csv
#ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "sourcedir=.\csvfiles"
SET "destdir=c:\destdir"
FOR /f "delims=" %%a IN ('dir /b /a-d "%sourcedir%\*.csv" ') DO (
SET "csvname=%%~na"
IF NOT "!csvname:*_=!"=="!csvname!" (
CALL :finddate
ECHO MD "%destdir%\!csvname!"
ECHO MOVE "%sourcedir%\%%a" "%destdir%\!csvname!\"
)
)
GOTO :EOF
:finddate
IF /i "%csvname:~-6%"=="_audit" SET "csvname=%csvname:~0,-6%"
IF "%csvname:*_=%"=="%csvname%" SET "csvname=%csvname:~0,6%"&GOTO :EOF
SET "csvname=%csvname:*_=%"
GOTO finddate
When applied to a directory '.\csvfiles` with content
GO.YO-WTR-SOO5-PT-20140102110.csv
GO.YO_WTR_SOO5_PT_20140102110.csv
Produced output
MD "c:\destdir\201401"
MOVE ".\csvfiles\GO.YO_WTR_SOO5_PT_20140102110.csv" "c:\destdir\201401\"
The required commands are merely ECHOed for testing purposes. After you've verified that the commands are correct, change ECHO MD to MD to actually create the directories. Append 2>nul to suppress error messages (eg. when the directory already exists)
Change ECHO MOVE to MOVE to actually move the files. Append >nul to suppress report messages (eg. 1 file moved)
Amendment - adjustment for ..._audit.csv.
Related
Coding is not my speciality but I have come across a problem and google search has guided me to using batch file process in solving it. Essentially I have a couple of thousands of files that need to be moved into folders and they have a very simple file structure, listed below:
UK--London--Filename.pdf
UK--London--Filename2.pdf
UK--Manchester--Filename3.pdf
UK--Liverpool--Filename4.pdf
UK--Chester--Filename5.pdf
I would like the script to:
1. Pick up the first "--" check if the folder exists, if not create it
2. Pick up the second "--" check if the folder exists, if not create it
3. As there might be more than two "--", ignore the rest
4. Move file into the subfolder
To that end, the output should be some like (note "FILETEST" is the folder I am using to test the script):
C:\FILETEST\UK\London\UK--London--Filename.pdf
C:\FILETEST\UK\London\UK--London--Filename2.pdf
C:\FILETEST\UK\Manchester\UK--Manchester--Filename3.pdf
C:\FILETEST\UK\Liverpool\UK--Liverpool--Filename4.pdf
C:\FILETEST\UK\Chester\UK--Chester--Filename5.pdf
I have had an attempt to re-using a script from another question in stackoverflow (Batch create folders based on part of file name and move files into that folder). I understand that it would not do exactly what I need, but cant seem to get any output.
#ECHO OFF
SETLOCAL
SET "sourcedir=c:\FILETEST"
PUSHD %sourcedir%
FOR /f "tokens=1*delims=--" %%a IN (
'dir /b /a-d *.*.*'
) DO (
ECHO MD %%a
ECHO MOVE "%%a.%%b" --\%%a\
)
POPD
GOTO :EOF
Apologies for any headaches caused, I am hoping this is a simple one to solve.
Thank you,
Panos
#ECHO OFF
SETLOCAL
SET "sourcedir=c:\FILETEST"
PUSHD %sourcedir%
FOR /f "tokens=1,2*delims=-" %%a IN (
'dir /b /a-d *--*--*.*'
) DO if "%%c" neq "" (
ECHO MD "%%a"
ECHO MD "%%a\%%b"
ECHO MOVE "%%a--%%b--%%c" ".\%%a\%%b\"
)
POPD
GOTO :EOF
Read the directory list of files in the current directory, (/a-d = no directorynames) that match *--*--*. Tokenise so that %%a acquires the part before the first --sequence, %%b the second and %%c the remainder.
If %%c is not empty then make the directories ".\%%a" and ".\%%a\%%b" (quoted because any spaces in the name would otherwise be seen as "create two directories") then move the file, again quoted for the same reason.
Note that each character individually between delims= and the close-quote is a delimiter - a delimiter-string is not supported. Consequently, this code will pick up - as well as --- and any other sequence of - and try to process it. You could gate the create/move further by adding if exist "%%a--%%b--%%c" directly after the if "%%c" neq ""before the (.
The md will create a directory if the target name does not already exist, and produce an error-message if it already exists. To suppress the error message, append 2>nul to the md lines.
I have many files in many folders that I need to rename.
And example is
from cgs2016-09-05-05-40-34.xls
to cgs0905.xls
and
from cgs2016-09-06-05-40-34
to cgs0906.xls
etc
Any help would be greatly appreciated!
#Jamaz Try out the following code below on a sample of your files. Again please use it on a test sample of your files so it does not cause you issues if it makes a mistake. Thank you and please up-vote if this works for you.
setlocal enabledelayedexpansion
REM Collect list of file names in current directory that have the .xls file extension. Output to text file.
dir /b "*.xls" >xls.txt
REM For loop examines the text file for individual file names.
FOR /F "tokens=1" %%# in (.\xls.txt) do (
REM SET variable "#" to equal "token"
Set "token=%%#"
REM Extract the first 3 characters (year) from the file name and set is to variable "token"
Set "tokenchar=!token:~0,3!"
REM Extract the month characters from the file name and set the variable as "tokenmonth"
Set "tokenmonth=!token:~8,2!"
REM Extract the day characters from the file name and set the variable as "tokenday"
Set "tokenday=!token:~11,2!"
ren "%%#" "!tokenchar!!tokenmonth!!tokenday!.xls"
echo %%#
)
Pause
not the best way, but works for your examples:
#echo off
setlocal enabledelayedexpansion
for %%x in (*.xls) do (
set "filename=%%x"
ECHO ren "%%x" "!filename:~0,3!!filename:~8,2!!filename:~11,2!.xls"
)
remove the ECHO if output is ok.
Because the last nineteen characters, date and time stamp, are more likely to be constant than the first three, (especially over multiple folders), I'd change both the previous answers to cater for that rationale.
#Echo Off
SetLocal EnableDelayedExpansion
(Set _rf=C:\Users\jamaz\TestDir)
(Set _fe=xls)
If Not Exist "%_rf%\" Exit/B
For /R "%_rf%" %%I In (*.%_fe%) Do (Set "_fn=%%~nI"
Echo=Ren "%%I" "!_fn:~,-19!!_fn:~-14,2!!_fn:~-11,2!%%~xI")
Timeout -1 1>Nul
EndLocal
Exit/B
As the OP was not clear about whether the code was for multiple same level folders or subfolders rooted from a single location, I went for the latter as the previous responses had already covered that.
Change your chosen file path and extension on lines 4 and 5
If you are happy with the console output, remove echo= from line 10 and delete line 11
I have hundreds of csv files . csv files are stored in folders and sub folders . I want to search fifty csv file whose file names have been determined , for example 1.csv , 2.csv , 3.csv , ... , 50.csv . very troublesome if I searched one by one using the Windows search tool . I would like if the files are found , save in the folder named FOUND . please help to overcome this problem by using the batch programming / bat ? thank you very much
There's a number of approaches one can take, depending on how much automation you require... To help you get started, you may want to look at this it helped me (and indeed continues to do so) when I started learning batch. Furthermore I will provide one possible template for achieving your objective, as I have interpreted it. Perhaps it is not the most elegant or efficient method, but it introduces a number of batch commands that you may or may not have encountered, which in turn may help you develop your own method.
#echo off
setlocal enabledelayedexpansion
echo Please enter a drive letter:
set /p "drive=>"
echo Please enter a search string:
set /p "searchstring=>"
echo %searchstring%>search.txt
set /p search=<search.txt
set /a suffix=0
echo.>>search.txt
:LOOP
for /f "tokens=*" %%i in ("search.txt") do (
set /a suffix=suffix+1
set seq=%search% !suffix!
echo !seq!>>search.txt
)
if !suffix! leq 49 goto LOOP
for /f "tokens=*" %%i in (search.txt) do (
for /f "tokens=*" %%j in ('dir /b /s /a-d %drive%:\"%%i.csv" 2^>nul') do (
if not exist "%~dp0\found" md "%~dp0\found"
move /y "%%j" "%~dp0\found\%%~nxj"
)
)
pause
This is not intended as a definitive solution, though you may find it answers your original query/request. All the best.
Here's another working solution for you..
#ECHO OFF
SETLOCAL EnableDelayedExpansion
REM First Set your directories input and output
SET InputDir=C:\Directory to your CSV files\
SET OutputDir=C:\Directory to your CSV files\FOUND
REM check if the FOUND directory exist, if not, then create it.
IF NOT EXIST OutputDir (
mkdir %OutputDir%
)
REM Grab a scan of the input directory and save it to a temporary file list.
Dir /a /b %InputDir%>"%OutputDir%\Found.txt"
REM Set the files you would like to find.
SET "File1=1.csv"
SET "File2=2.csv"
SET "File3=50.csv"
REM The loop, to process the matching file(s).
FOR %%A IN (%File1%,%File2%,%File3%) DO (
FOR /F "usebackq" %%B IN ("%OutputDir%\Found.txt") DO (
IF %%A==%%B (
copy "%InputDir%\%%A" "%OutputDir%\%%A"
)
)
)
REM Clean up the temp file list.
DEL "%OutputDir%\Found.txt"
Make note, I didn't add quotes to the Input and Output variables, but instead added quotes to the copy portion of the code to compensate for white spaces in your directory path. I tried to keep it simple, so you could follow the logic of how it processed what you are looking for, you can now modify this to your liking.. Have fun. Cheers!
I am trying to create a batch script on windows 7 to do the following:
I have a folder which another program dumps files to.
All the files have numbers in their name along with other identifying information.
I would like to have a batch script search for all the digits in the file name and then create a folder (folder name is just the digits) and move all files that contain those digits to the folder.
It must be applicable to numerous users in my office.
currently i have a very bad primitive system running which doesn't account for mistakes:
#echo off
setlocal enabledelayedexpansion
pushd "%USERPROFILE%\Desktop\RawFiles"
for %%a in (*) do (
set fldr=%%~na
set fldr=!fldr:~0,5!
md "!fldr!"
move "%%a" "!fldr!"
)
popd
if not exist "%USERPROFILE%\Dropbox\agents" mkdir "%USERPROFILE%\Dropbox\agents"
SET "src_folder=%USERPROFILE%\Desktop\RawFiles"
SET "tar_folder=%USERPROFILE%\Dropbox\agents"
for /f %%a IN ('dir "%src_folder%" /b') do move /-y %src_folder%\%%a %tar_folder%
exit
the files in the "rawfiles" folder are as follows:
12345 - tech pack.pdf
12345.pdf
12345-artwork.AI
"#12345- artwork.AI"
What i created only works for perfect instances where the numbers come first in files and are exactly 5.
Unfortunately there is a lot of human error here so this solution is not viable.
an example of a mistake is an accidental 6 digit number or even putting the "#" sign before the numbers
I also would like to be able to override the files in the destination folder by running this twice but am getting "access denied".
Please help!
thanks
The Batch file below extract the digits from the file names as requested (maximum 6 groups of digits separated by other characters, this may be modified), so you may manipulate they in any way you wish; the ECHO commands are just examples. Note that the space must be the last character in eliminate variable.
#echo off
setlocal EnableDelayedExpansion
set "eliminate=#-abcdefghijklmnopqrstuvwxyz "
for %%a in (*.*) do (
for /F "tokens=1-6 delims=%eliminate%" %%b in ("%%~Na") do set folder=%%b%%c%%d%%e%%f%%g
if not exist "!folder!" ECHO md "!folder!"
ECHO move "%%a" "!folder!"
)
EDIT 1
STEP 1:
The telephonic conversations are recorded in .WAV format in specific folder and sub-folders (created AUTOMATICALLY by the the voice recording software in the current date format, i.e., 20121119 (YYYYMMDD). This naming convention cannot be changed. Current date sub-folders are automatically created in D Drive in the folder called RECFILED. Say, if the recordings are for today, the files would be stored in 20121119 sub-folder. Yesterday's files were stored in 20121118.
STEP 2:
At the end of the day, these *.WAV files needs to be converted to *.MP3 format and to be uploaded to Amazon S3. At present this process is manual. Since, there are lot many WAV files, so I use SOX to batch convert the WAV to MP3. For this purpose, I have created a batch file (explained in my original question) so that this conversion process can be automated. This batch file converts the WAV to MP3 and saves the MP3 files in same folder as of the WAV files. For this, what I have to do is to copy the batch file in the folder and run it. It converts the files and save it in the same folder.
STEP 3: Once the files are converted. Then on Amazon S3, in a specific bucket, I have to create a new folder with current date so that all these MP3's can be stored there. BUT, the date format here is DD.MM.YYYY. The folder hierarchy is \BucketName\Voice\201211\19.11.2012\*.MP3 (for today), \BucketName\Voice\201211\20.11.2012\*.MP3 (for tomorrow) and so on.
Now, the problem is:
Traverse to the latest folder (looking in to d:\RecFileD\YYYYMMDD) and see if there are WAV files available in the folder. If yes, the convert these files to MP3 and store them in the folder called DD.MM.YYYY on local server on any specific location. (today's date but with a different format).
Once, the folder is created (with DD.MM.YYYY naming convention. The same folders needs to be uploaded on S3 in a specific month (i.e., 201211). And once the month changes, say December, the files related to December month would go in the folder 201212 and so on.
The problem here is that on local server the naming convention is YYYYMMDD (without spaces, dot or comma) and on S3 the naming convention is DD.MM.YYYY (with dots).
ORIGINAL QUESTION
Please help me write a batch file so that I can automate the process of conversion of WAV files to MP3 and then uploading them directly to Amazon S3 to specific folders. Right now it is a manual process.
Actually, we are running a small call centre and all the voice calls are recorded and saved on the server in D: drive in folder named RecFileD and sub-folders named with the current date (i.e., 20121117, 20121116 and so on). The files are saved in WAV format by default. I need to convert the files to MP3 before uploading them to Amazon S3 for storage.
The requirement is that I need to upload the MP3 files daily on the S3 on a specific time at the end of the day. The problem is how to traverse to the last folder (current date folder) and convert the files. On local server the voice files are saved in d:\RecFileD\20121117\*.wav and on Amazon S3 the files are uploaded in folders:
\BucketName\Voice\201211\17.11.2012\*.mp3 (this is for November month);
\bucketName\Voice\201212\01.12.2012\*.mp3 (this would be for Dec month) (31 folders for all days).
To automate the conversion, I have created the below batch file. This file uses the SOX application to convert the WAV files to MP3 in the current folder.
#echo off
call :treeprocess
goto :eof
:treeprocess
for %%f in (*.wav) do
(
sox %%~nf.WAV %%~nf.mp3
sox %%~nf.WAV %%~nf-short.mp3 trim 0:30 1:00
)
for /D %%d in (*) do
(
cd %%d
call :treeprocess
cd ..
)
exit /b
To automate the uploading of files to S3, I'd be using S3 command line tool.
In brief, following steps are required:
Traverse to the current date folder only (20121115, 20121116, 20121117 etc.) on local server and convert the WAV files to MP3 (using the above script).
Move those MP3 files to the separate folder created automatically named as 17.11.2012 (as per current date).
Upload the folder to Amazon S3 on specific location. i.e., \bucketname\voice\201211\17.11.2012.
Wow! This sound much more complex than really is!
#echo off
rem Create folder names from current date, MM/DD/YYYY locale format is assumed
for /F "tokens=1-3 delims=/" %%a in ("%date%") do (
set YYYYMMDD=%%c%%a%%b
set YYYYMM=%%c%%a
set DD.MM.YYYY=%%b.%%a.%%c
)
rem Enter into target folder
cd /D D:\RecFileD\%YYYYMMDD%
rem Convert WAV files to MP3 using SOX
for %%f in (*.wav) do (
sox %%~nf.WAV %%~nf.mp3
sox %%~nf.WAV %%~nf-short.mp3 trim 0:30 1:00
)
rem Move MP3 files to brother folder
md ..\%DD.MM.YYYY%
move *.mp3 ..\%DD.MM.YYYY%
rem Upload the folder to Amazon S3
echo S3COPY from ..\%DD.MM.YYYY% to \bucketname\voice\%YYYYMM%\%DD.MM.YYYY%
I suggest you to be as concise as possible when describing your problem, but don't forget any details. Por example, in your (long) description, the local folder named 17.11.2012 is not enough explained!
I hope this is what you wanted...
Antonio
What you have is pretty good, you're pretty close.
The environment I was testing on required do ( to have the open paren on the same line as the do. Your formatting with a newline in the middle may be causing a problem.
What you're totally missing is any parsing of the directory name which is expected to be YYYYMMDD. You can do that with:
set dirname=%%d
set year=%dirname:~0,4%
set month=%dirname:~4,2%
set day=%dirname:~6,2%
Once your done this it's easy to create file names and paths based on YYYY, MM, DD:
set s3path=!file_year!!file_month!\!file_day!.!file_month!.!file_year!
will generate a path like YYYYMM\DD.MM.YYYY.
You can get the 'last' dir using:
for /f "tokens=1" %%a IN ('dir /b /a:d /o:n ????????') do (
set dirset=%%a
)
Note: this is only implemented in the second solution. Let's break this down:
dir /b /a:d /o:n ????????
Does a directory in 'bare' format (just the list of matching files, one per line), with attribute directory (only list directories), orders by name (this is the default on NTFS but not on FAT so best to specify sort order), matching ????????, any 8 characters (because the directories are expected to be named like YYYYMMDD so always 8 characters). This returns an ordered list of 8 character directory names.
for /f "tokens=1" %%a IN ('command') do echo %%a
Executes the command and parses the results, line by line. Here the first token of each result will be echoed.
for /f "tokens=1" %%a IN ('dir /b /a:d /o:n ????????') do (
set dirset=%%a
)
We put it all together and see that dirset will be set to each matching directory name. But after the for loop finishes it will be left set to the last value, or 'latest' directory.
In the code below I have dirname set separately to avoid problems with variable expansion rules. Alternatively, you should be able to use:
setlocal enableextensions enabledelayedexpansion
set dirname=%%d
set year=!dirname:~0,4!
You problem, as stated, does not require recursion. My code just iterates each dir, then iterates each file. If the file layout is less structured then you indicate, then recursion may be needed.
You didn't specify which Windows S3 command line tool you use so I echo *S3COPY* with local full path and partial path. You should be able to replace this with your copy command.
You'll need to run this from d:\RecFileD or you could add this near the top of the bat file:
d:
cd \RecFileD
You'll probably need to change s3root to the actual root dir of your local S3 copy. Instead of moving the files, I have sox create them in the correct location.
I set year, month, day vars in processfiles because setting them in processdirs is complicated by variable expansion rules.
If you're doing much more than this, I'd recommend looking into Python. It's got a great community / eco-system, is easy to get started with and is free. Plus you don't wind up spending all your time fighting with the language.
Here's my first try:
#echo off
setlocal
set s3root=d:\s3\bucket\voice
call :processdirs
goto :eof
:processfiles
set year=%dirname:~0,4%
set month=%dirname:~4,2%
set day=%dirname:~6,2%
set s3path=%year%%month%\%day%.%month%.%year%
set s3dir=%s3root%\%s3path%
if not exist "%s3dir%" md "%s3dir%"
for %%f in (*.wav) do (
sox "%%~nf.WAV" "%s3dir%\%%~nf.mp3"
sox "%%~nf.WAV" "%s3dir%\%%~nf-short.mp3" trim 0:30 1:00
)
echo *S3COPY* %s3dir% %s3path%
goto :eof
:processdirs
for /D %%d in (*) do (
set dirname=%%d
cd "%%d"
call :processfiles
cd ..
)
goto :eof
#Aacini answer made me realize, unfortunately my solution is lacking. It doesn't process only today's files. But I'm concerned with what happens when a day is skipped.
I added two parameters to control what is processed. The first parameter specifies a named filter and can be one of:
newlatest - new files in latest directory, based on filename (default)
latest - all files in latest directory, based on filename
today - today's directory
newdirs - all dirs (missing dates) that don't exist in the S3 tree
newfiles - all files that don't exist in the S3 tree
all - all files (used to overwrite corruption in S3 tree)
If the filter is newdirs, newfiles or all, then a second parameter can be used to further filter on directory name. You can use the * and ? wildcard characters to match a set of files.
If you save the script as ProcDirs.bat then here are some examples:
ProcDirs all 20121119
Will force the processing (or reprocessing) of the specified dir.
ProcDirs newdirs 201211??
Will process new directories (missing from output tree) that match the dir name (any day of the specified year and month).
ProcDirs newfiles 2012????
Will process new files (missing from output tree) in directories that match the dir name (any day of the specified year).
ProcDirs
ProcDirs newlatest
Are the exact same because newlatest is the default. This will process new files in the (lexically) 'latest' directory
The code is more complicated, but not too bad. I did try to use #Aacini's code to get today's month/day/year but it didn't work on my system (because my date format must be different than required). So I'm using a different approach that doesn't depend on local date formats.
My first solution didn't require delayed expansion but this one does so I turn it on with setlocal (works on Win XP but maybe not older Windows) and use ! instead of % for environment variable substitution.
#echo off
setlocal enableextensions enabledelayedexpansion
set s3root=d:\s3\bucket\voice
rem Set the default filter mode
set newfilter=none
set dirsetfilter=none
set arg=%1
if "!arg!" == "" set arg=newlatest
if "!arg!" == "newdirs" (
set newfilter=newdirs
) else if "!arg!" == "newfiles" (
set newfilter=newfiles
) else if "!arg!" == "all" (
set dirsetfilter=none
set newfilter=none
) else if "!arg!" == "today" (
set dirsetfilter=today
) else if "!arg!" == "latest" (
set dirsetfilter=latest
) else if "!arg!" == "newlatest" (
set newfilter=newfiles
set dirsetfilter=latest
)
if !dirsetfilter! == today (
for /f "skip=1 tokens=1-3" %%a IN ('wmic path Win32_LocalTime Get Day^,Month^,Year /Format:table') do (
if %%a GTR 0 (
set now_day=%%a
set now_month=%%b
set now_year=%%c
)
)
set dirset=!now_year!!now_month!!now_day!
if not "%2" == "" echo Second parameter, dirset, ignored when filter is today
) else if !dirsetfilter! == latest (
rem pull out the name of the 'last' directory
for /f "tokens=1" %%a IN ('dir /b /a:d /o:n ????????') do (
set dirset=%%a
)
if not "%2" == "" echo Second parameter, dirset, ignored when filter is latest
) else if not "%2" == "" (
rem The second parameter is dirset. Wild card chars, *? allowed
rem only matched dir(s) processed
set dirset=%2
) else (
rem process all dirs that match filter
set dirset=*
)
call :processdirs
goto :eof
:processfiles
set file_year=!dirname:~0,4!
set file_month=!dirname:~4,2!
set file_day=!dirname:~6,2!
set s3path=!file_year!!file_month!\!file_day!.!file_month!.!file_year!
set s3dir=!s3root!\!s3path!
set skipdir=FALSE
if not exist "!s3dir!" (
md "!s3dir!"
) else (
if newdirs == !newfilter! set skipdir=TRUE
)
if !skipdir! == FALSE (
set havenewfiles=FALSE
for %%f in (*.wav) do (
set skipfile=FALSE
if newfiles==!newfilter! if exist "!s3dir!\%%~nf.mp3" set skipfile=TRUE
if !skipfile! == FALSE (
set havenewfiles=TRUE
echo sox "%%~nf.WAV" "!s3dir!\%%~nf.mp3"
sox "%%~nf.WAV" "!s3dir!\%%~nf.mp3"
)
set skipfile=FALSE
if newfiles == !newfilter! if exist "!s3dir!\%%~nf-short.mp3" set skipfile=TRUE
if !skipfile! == FALSE (
set havenewfiles=TRUE
echo sox "%%~nf.WAV" "!s3dir!\%%~nf-short.mp3" trim 0:30 1:00
sox "%%~nf.WAV" "!s3dir!\%%~nf-short.mp3" trim 0:30 1:00
)
)
if !havenewfiles! == TRUE (
echo *S3COPY* !s3dir! !s3path!
)
)
goto :eof
:processdirs
for /D %%d in (!dirset!) do (
echo Process Dir: %%d
set dirname=%%d
cd "%%d"
call :processfiles
cd ..
)
goto :eof
Good luck. I hope this helps.