. bat que une varios txt

Iniciado por otrebo, 18 Marzo 2012, 18:33 PM

0 Miembros y 1 Visitante están viendo este tema.

elqueteconte

Saludos;

He heredado el siguiente script:

copy /y blancos\*.TXT .

copy CM.txt + C:\carp1\Emp1\20150908\CM.txt CM.txt
copy GL.txt + C:\carp1\Emp1\20150908\GL.txt GL.txt
copy IMP6000.txt + C:\carp1\Emp1\20150908\IMP6000.txt IMP6000.txt
copy IMP6001.txt + C:\carp1\Emp1\20150908\IMP6001.txt IMP6001.txt
copy IMP6002.txt + C:\carp1\Emp1\20150908\IMP6002.txt IMP6002.txt
copy IMP6003.txt + C:\carp1\Emp1\20150908\IMP6003.txt IMP6003.txt

copy CM.txt + C:\carp1\Emp1\20150909\CM.txt CM.txt
copy GL.txt + C:\carp1\Emp1\20150909\GL.txt GL.txt
copy IMP6000.txt + C:\carp1\Emp1\20150909\IMP6000.txt IMP6000.txt
copy IMP6001.txt + C:\carp1\Emp1\20150909\IMP6001.txt IMP6001.txt
copy IMP6002.txt + C:\carp1\Emp1\20150909\IMP6002.txt IMP6002.txt
copy IMP6003.txt + C:\carp1\Emp1\20150909\IMP6003.txt IMP6003.txt

copy CM.txt + C:\carp1\Emp1\20150910\CM.txt CM.txt
copy GL.txt + C:\carp1\Emp1\20150910\GL.txt GL.txt
copy IMP6000.txt + C:\carp1\Emp1\20150910\IMP6000.txt IMP6000.txt
copy IMP6001.txt + C:\carp1\Emp1\20150910\IMP6001.txt IMP6001.txt
copy IMP6002.txt + C:\carp1\Emp1\20150910\IMP6002.txt IMP6002.txt
copy IMP6003.txt + C:\carp1\Emp1\20150910\IMP6003.txt IMP6003.txt

copy CM.txt + C:\carp1\Emp1\20150911\CM.txt CM.txt
copy GL.txt + C:\carp1\Emp1\20150911\GL.txt GL.txt
copy IMP6000.txt + C:\carp1\Emp1\20150911\IMP6000.txt IMP6000.txt
copy IMP6001.txt + C:\carp1\Emp1\20150911\IMP6001.txt IMP6001.txt
copy IMP6002.txt + C:\carp1\Emp1\20150911\IMP6002.txt IMP6002.txt
copy IMP6003.txt + C:\carp1\Emp1\20150911\IMP6003.txt IMP6003.txt

copy CM.txt + C:\carp1\Emp1\20150912\CM.txt CM.txt
copy GL.txt + C:\carp1\Emp1\20150912\GL.txt GL.txt
copy IMP6000.txt + C:\carp1\Emp1\20150912\IMP6000.txt IMP6000.txt
copy IMP6001.txt + C:\carp1\Emp1\20150912\IMP6001.txt IMP6001.txt
copy IMP6002.txt + C:\carp1\Emp1\20150912\IMP6002.txt IMP6002.txt
copy IMP6003.txt + C:\carp1\Emp1\20150912\IMP6003.txt IMP6003.txt

Como pueden ver la variable "carp1"; "Emp1" son constantes pero la carpeta siguiente corresponde a los días del mes.

La idea es como hago para que cuando ejecuto el script le pase por parámetro el nombre de la Empresa y haga un recorrido por las carpetas que y vaya haciendo la copia hasta que consiga la ultima carpeta.

Desde ya mil gracias....