[OT] Moving contents inside thousand sub-directories @ once

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi There,

Forgive me if this is a rather off topic. Yesterday, I was given a DVD by a
friend that only contains thousand of sub-directories as follows:

h:\8090 0000 even\0000.tif
h:\8090 0002 even\0002.tif
 
Hi There,

Forgive me if this is a rather off topic. Yesterday, I was given a DVD by a
friend that only contains thousand of sub-directories as follows:

h:\8090 0000 even\0000.tif
h:\8090 0002 even\0002.tif
.
:
h:\8090 1890 even\1890.tif
h:\8090 0001 odd\0001.tif
h:\8090 0003 odd\0003.tif
.
:
h:\8090 1891 odd\1891.tif

As you notice above, each subdirectory only contains a TIFF file. All my
friend wants is to move all those TIFF files into a single sub-directory at
once, instead of doing it manually. This seems a simple task to perform;
however, I am just clueless trying to do this on my win2k3 Ent server. Is
this doable? If so, how?

Again, I apologize for posting such an off topic post here.

1. Create a c:\TiffFolder on your Server.
2. Run the following batch:

@echo off
setlocal
set /a cnt=100000
for /f "Tokens=*" %%t in ('dir H:\*.tif /b /s') do (
call :copyit "%%t"
)
endlocal
goto :EOF
:copyit
set name=%cnt%
set /a cnt=%cnt% + 1
set name=c:\TiffFolder\%name:~1,5%.tif
copy %1 %name%


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Or second and a bit easier way -- right click on your DVD drive under
Windows Explorer, choose search, and type "*.tif" as expression. From
search results window select all files (ctrl+A) then ctrl+c and ctrl+v
on your new folder. :))
 
Back
Top