Re: Dos batch file to sort files based on file names.
- From: "Jon Osborn" <josborn@xxxxxxxxx>
- Date: Mon, 19 May 2008 15:45:54 -0500
I didn't know about the set types command.
This works fine.
Quick question what is the %%A do in the for statement. I know it is an
increament counter but how does it work? How does it know how many time to
run?
Thanks,
Jon
The approach you posted seems needlessly complex. I would think
something like this would get the job done ...
@echo off
set source=D:\Contents\Cherrypick_test
set target1=D:\contents\lost_and_found folder
set target2=D:\Contents\Cherrypick_test
:: List of file types
set types=Jonesboro;"Little Rock";Dallas;Houston;^
memphis;Authorized;General
:: Move matching files
for %%a in (%types%) do (
move "%source%\*%%~a*.m2t" "%target2%\%%~a")
:: Whatever's left move to lost and found
move "%source%\*.m2t" "%target1%"
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.
- Follow-Ups:
- Re: Dos batch file to sort files based on file names.
- From: Tom Lavedas
- Re: Dos batch file to sort files based on file names.
- References:
- Dos batch file to sort files based on file names.
- From: Jon Osborn
- Re: Dos batch file to sort files based on file names.
- From: Tom Lavedas
- Dos batch file to sort files based on file names.
- Prev by Date: Re: Dos batch file to sort files based on file names.
- Next by Date: Re: script error message
- Previous by thread: Re: Dos batch file to sort files based on file names.
- Next by thread: Re: Dos batch file to sort files based on file names.
- Index(es):