Ernesto
asked on
how copy a file to the same directory robocopy
hi all
i want to achive this
robocopy f:\Carpetas Compartidas\pegar.TXT /mir z:\
robocopy f:\Carpetas Compartidas\pipe.TXT /mir z:\
robocopy f:\Carpetas Compartidas\REQUISvv.DOC /mir z:\
robocopy f:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC /mir z:\
is a huge txt file that i need to replace documents to the same route in drive z:
is any way to do this whit robocopy
tsm you experts
i want to achive this
robocopy f:\Carpetas Compartidas\pegar.TXT /mir z:\
robocopy f:\Carpetas Compartidas\pipe.TXT /mir z:\
robocopy f:\Carpetas Compartidas\REQUISvv.DOC /mir z:\
robocopy f:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC /mir z:\
is a huge txt file that i need to replace documents to the same route in drive z:
is any way to do this whit robocopy
tsm you experts
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want to change something, you need to change the way the copy is performed. With "original .txt", do you mean the file containing the commands?
Please explain your question .....
Yes, please explain further.
~bp
~bp
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thats it!!
newvillage
newvillage
Bill's 2nd solution should work for you. Still, you'd need to revise that huge .txt file somehow. As an alternative, maybe this will help....
Notes:
- Copy the code below and save to a .bat file of your choice.
- Revise set fn=HugeFile.txt to match your filename of your .txt file. If the file is in a certain folder, you can add the folder name, too. e.g. c:\user\me\documents\hugef ile.txt
- This version uses ECHO robocopy for testing (visual) purposes. When you are satisfied that it looks like it will work, remove the ECHO in front of robocopy and save the .bat file. Then run it live.
- When running it live, let me know if you experience errors. Errors will show in the HugeFileCopy.log
Notes:
- Copy the code below and save to a .bat file of your choice.
- Revise set fn=HugeFile.txt to match your filename of your .txt file. If the file is in a certain folder, you can add the folder name, too. e.g. c:\user\me\documents\hugef
- This version uses ECHO robocopy for testing (visual) purposes. When you are satisfied that it looks like it will work, remove the ECHO in front of robocopy and save the .bat file. Then run it live.
- When running it live, let me know if you experience errors. Errors will show in the HugeFileCopy.log
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set fn=HugeFile.txt
for /f "tokens=*" %%A in (%fn%) do (
set dv=%%~dA
set pt=%%~pA
set f=%%~nA%%~xA
ECHO robocopy "!dv!!pt!" "z:!pt!" "!f!" /SECFIX /R:3 /W:3 /log+:HugeFileCopy.log
)
goto :eof
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i do it whit a copy
tsm all
copy "f:\Carpetas Compartidas\pegar.TXT " "z:\Carpetas Compartidas\pegar.TXT "
copy "f:\Carpetas Compartidas\pipe.TXT " "z:\Carpetas Compartidas\pipe.TXT "
copy "f:\Carpetas Compartidas\REQUISvv.DOC " "z:\Carpetas Compartidas\REQUISvv.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC " "z:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\PLANEACION INTEGRAL.DOC " "z:\Carpetas Compartidas\1 PLANEACION\PLANEACION INTEGRAL.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\Portada.DOC " "z:\Carpetas Compartidas\1 PLANEACION\Portada.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\SEPARADOR.DOC " "z:\Carpetas Compartidas\1 PLANEACION\SEPARADOR.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 Codigos y Normas aplicables_ Rev 2.DOC " "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 Codigos y Normas aplicables_ Rev 2.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 NOM aplicables.DOC " "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 NOM aplicables.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-105-STP S-1994 CANCELADA.DOC " "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-105-STP S-1994 CANCELADA.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-114-STP S-1994 CANCELADA.DOC " "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-114-STP S-1994 CANCELADA.DOC "
copy "f:\Carpetas Compartidas\APOLONIO\AGM.D OC " "z:\Carpetas Compartidas\APOLONIO\AGM.D OC "
tsm all
copy "f:\Carpetas Compartidas\pegar.TXT " "z:\Carpetas Compartidas\pegar.TXT "
copy "f:\Carpetas Compartidas\pipe.TXT " "z:\Carpetas Compartidas\pipe.TXT "
copy "f:\Carpetas Compartidas\REQUISvv.DOC " "z:\Carpetas Compartidas\REQUISvv.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC " "z:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\PLANEACION INTEGRAL.DOC " "z:\Carpetas Compartidas\1 PLANEACION\PLANEACION INTEGRAL.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\Portada.DOC " "z:\Carpetas Compartidas\1 PLANEACION\Portada.DOC "
copy "f:\Carpetas Compartidas\1 PLANEACION\SEPARADOR.DOC " "z:\Carpetas Compartidas\1 PLANEACION\SEPARADOR.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 Codigos y Normas aplicables_ Rev 2.DOC " "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 Codigos y Normas aplicables_ Rev 2.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 NOM aplicables.DOC " "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\Anexo 13 NOM aplicables.DOC "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-105-STP
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-114-STP
copy "f:\Carpetas Compartidas\APOLONIO\AGM.D
Very inconvenient, as you have write anything twice, but if that works for you ...
However, I doubt it does, or are those trailing spaces part of the file name?
However, I doubt it does, or are those trailing spaces part of the file name?
ASKER
it does!!
ASKER
to that way