batch move multiple files to same name folder

Microsoft Windows xp professional w/sp2
January 30, 2010 at 15:53:41
Specs: Windows XP SP3
Hello, i have created multiple folder so I can
orginise my files. The files are all excel sheets
and are named smit14.xls, abbo10.xls etc.....
The folders are the same names excel sheets
however they are in a directory like this:
h:\PM\Pfiles\A\Abbot10\ or

what i need is to be able to move all the
current excel files which are currently sitting in
one folder to their assigned folder

See More: batch move multiple files to same name folder

Report •

January 30, 2010 at 17:43:35
@echo off & setLocal EnableDELAYedeXpansion

pushd c:\files

for /f "tokens=* delims= " %%a in ('dir/b *.xls') do (
set F=%%a
set F=!F:~0,1!
move %%a h:\PM\Pfiles\!F!

Helping others achieve escape felicity


Report •
Related Solutions

Ask Question