Solved

how copy a file to the same directory  robocopy

Posted on 2015-02-13
12
221 Views
Last Modified: 2015-02-16
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
0
Comment
Question by:edo60
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 52

Accepted Solution

by:
Bill Prew earned 167 total points
ID: 40608366
Not sure exaclty what you are after, but if you just want the files in the root of Z: you can do:

robocopy "f:\Carpetas Compartidas"              z:\ "pegar.TXT"
robocopy "f:\Carpetas Compartidas"              z:\ "pipe.TXT"
robocopy "f:\Carpetas Compartidas"              z:\ "REQUISvv.DOC"
robocopy "f:\Carpetas Compartidas\1 PLANEACION" z:\ "LISTADO PROCEDIMIENTOS.DOC"

Open in new window


If you want them in the same folder then you can do:

robocopy "f:\Carpetas Compartidas"              "z:\Carpetas Compartidas"              "pegar.TXT"
robocopy "f:\Carpetas Compartidas"              "z:\Carpetas Compartidas"              "pipe.TXT"
robocopy "f:\Carpetas Compartidas"              "z:\Carpetas Compartidas"              "REQUISvv.DOC"
robocopy "f:\Carpetas Compartidas\1 PLANEACION" "z:\Carpetas Compartidas\1 PLANEACION" "LISTADO PROCEDIMIENTOS.DOC"

Open in new window


~bp
0
 

Author Comment

by:edo60
ID: 40608421
o man, i dont think i can manipulate the original .txt
to that way
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 40608611
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?
0
 
LVL 13

Expert Comment

by:Santosh Gupta
ID: 40608722
Please explain your question .....
0
 
LVL 52

Expert Comment

by:Bill Prew
ID: 40608810
Yes, please explain further.

~bp
0
 
LVL 23

Assisted Solution

by:NVIT
NVIT earned 167 total points
ID: 40608861
My guess...

He has a huge .txt file with filenames like:

f:\Carpetas Compartidas\pegar.TXT"
f:\Carpetas Compartidas\pipe.TXT"
f:\Carpetas Compartidas\REQUISvv.DOC"
f:\Carpetas Compartidas\1 PLANEACION\LISTADO PROCEDIMIENTOS.DOC"

...and he wants to do the robocopy thing.

... and he thinks he has to revise the original .txt to the way Bill showed.  With all those perfect spaces and stuff... Yikes. hehe.

Just a guess...
0
Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

 

Author Comment

by:edo60
ID: 40609110
thats it!!
newvillage
0
 
LVL 23

Expert Comment

by:NVIT
ID: 40609141
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\hugefile.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
@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

Open in new window

0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
ID: 40609510
RoboCopy seems to be oversize here. XCopy should do better for single files.
0
 

Author Comment

by:edo60
ID: 40613059
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-STPS-1994 CANCELADA.DOC   "       "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-105-STPS-1994 CANCELADA.DOC   "
copy "f:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-114-STPS-1994 CANCELADA.DOC   "       "z:\Carpetas Compartidas\5106 NORMAS APLICABLES GASODUCTOS\NOM\NOM-114-STPS-1994 CANCELADA.DOC   "
copy "f:\Carpetas Compartidas\APOLONIO\AGM.DOC   "       "z:\Carpetas Compartidas\APOLONIO\AGM.DOC   "
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 40613076
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?
0
 

Author Comment

by:edo60
ID: 40613142
it does!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now