Notices

Water Fountain General Chit/Chat

Reply
 
LinkBack Thread Tools
Old 01-26-06, 10:45 PM   #1 (permalink)
Aximsite Légende
 
Frenchy's Avatar
Addicted Member
 
Join Date: Jul 2004
Location: Up North
Posts: 23,619
Device: iPhone 3G
Carrier: 10-4
Thanked 7 Times in 7 Posts

Awards Showcase
Platinum Poster Aximsite Veteran Staff Aximsite Active Silver Member Aximsite Silver Contributors Admin Medal Gold Poster Aximsite Gold Referrer Top Notch MyPDA 
Total Awards: 9

Need help with Robocopy Line command program...

Big migration project and one tool do not work and need to be replace ASAP.

I will give more details if someone can help. Basically I would like to copy some of the content of old PCs drive to a server and back to the PC. I would like to make it to a silent backup and restore. The folders are as follow:

c:\Documents and Settings\Username\Application Data\*.*
c:\Documents and Settings\Username\Cookies\*.*
c:\Documents and Settings\Username\Desktop\*.*
c:\Documents and Settings\Username\Favorites\*.*
c:\Documents and Settings\Username\Local Settings\*.*
c:\Documents and Settings\Username\My Documents\*.*
c:\data\*.*
__________________
If you get dead silence after breaking the speed of sound, would you be in the darkness after passing the speed of light?
.
Frenchy
Frenchy is offline   Reply With Quote
Sponsor Ads
Old 01-26-06, 10:49 PM   #2 (permalink)
Noisy Crow
Guest
 
Posts: n/a
xcopy should do just fine for that...
  Reply With Quote
Old 01-26-06, 10:52 PM   #3 (permalink)
Aximsite Légende
 
Frenchy's Avatar
Addicted Member
 
Join Date: Jul 2004
Location: Up North
Posts: 23,619
Device: iPhone 3G
Carrier: 10-4
Thanked 7 Times in 7 Posts

Awards Showcase
Platinum Poster Aximsite Veteran Staff Aximsite Active Silver Member Aximsite Silver Contributors Admin Medal Gold Poster Aximsite Gold Referrer Top Notch MyPDA 
Total Awards: 9

The non-working tool used to imput the real username of the old PC and copy the data to new name (yes, it is different ) on a server.

The Restore used to take this folder data and copy to the users login ID folder on the PC.

One command line I wrote looks like this:

robocopy c:\Documents and Settings\Punormana\Application Data\*.* \\snow2srv\Migration\punormana\Application Data /e /zb /r:1 /xo >appdata.LOG

It fails at this point and would be a manual input of the username and subject to typing errors.
__________________
If you get dead silence after breaking the speed of sound, would you be in the darkness after passing the speed of light?
.
Frenchy
Frenchy is offline   Reply With Quote
Old 01-26-06, 10:53 PM   #4 (permalink)
Aximsite Elite
 
silentknight's Avatar
Addicted Member
 
Join Date: Jan 2003
Location: GR, Michigan
Posts: 3,380
Device: Nokia 6255i
Carrier: Alltel
Thanked 1 Time in 1 Post

Awards Showcase
Aximsite Active Silver Member Aximsite Veteran Staff Moderator Medal 
Total Awards: 3

probably the spaces in the paths.. try quotes around them

we use robocopy here a lot, but i've written a program to do most of the work for me .. let me take a look at my code i know i've run into the spaces in paths problem before.


also you dont need the first "*.*" that can go after a space after the destination path.

this is what my command line usually looks like


Code:
ROBOCOPY.EXE \SRC\ \DEST\ *.* /FFT /NP /E /COPY:DAT /FP /W:1 /R:1 /LOG+:C:\LOGFILE.LOG
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


My recent reviews:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by silentknight; 01-26-06 at 10:57 PM.
silentknight is offline   Reply With Quote
Old 01-26-06, 10:56 PM   #5 (permalink)
Aximsite Légende
 
Frenchy's Avatar
Addicted Member
 
Join Date: Jul 2004
Location: Up North
Posts: 23,619
Device: iPhone 3G
Carrier: 10-4
Thanked 7 Times in 7 Posts

Awards Showcase
Platinum Poster Aximsite Veteran Staff Aximsite Active Silver Member Aximsite Silver Contributors Admin Medal Gold Poster Aximsite Gold Referrer Top Notch MyPDA 
Total Awards: 9

The problem with Xcopy is that if a file is corrupted, locked or uncopyable (?) the program stops and you have to find the file delete it or whatever is needed and restart the Xcopy. I have users with GB of data and it takes sometime 1-2 hours to copy it. If it fails you increase this time by 2-3. At the end of the day I am back to very little transfer done. :bang:
__________________
If you get dead silence after breaking the speed of sound, would you be in the darkness after passing the speed of light?
.
Frenchy
Frenchy is offline   Reply With Quote
Old 01-26-06, 10:58 PM   #6 (permalink)
Aximsite Légende
 
Frenchy's Avatar
Addicted Member
 
Join Date: Jul 2004
Location: Up North
Posts: 23,619
Device: iPhone 3G
Carrier: 10-4
Thanked 7 Times in 7 Posts

Awards Showcase
Platinum Poster Aximsite Veteran Staff Aximsite Active Silver Member Aximsite Silver Contributors Admin Medal Gold Poster Aximsite Gold Referrer Top Notch MyPDA 
Total Awards: 9

Originally Posted by silentknight
probably the spaces in the paths.. try quotes around them

we use robocopy here a lot, but i've written a program to do most of the work for me .. let me take a look at my code i know i've run into the spaces in paths problem before.


also you dont need the first "*.*" that can go after a space after the destination path.

this is what my command line usually looks like


ROBOCOPY.EXE \SRC\ \DEST\ *.* /FFT /NP /E /COPY:DAT /FP /W:1 /R:1 /LOG+:C:\LOGFILE.LOG
Thanks SilentKnight.. :approve:
__________________
If you get dead silence after breaking the speed of sound, would you be in the darkness after passing the speed of light?
.
Frenchy
Frenchy is offline   Reply With Quote
Old 01-26-06, 10:59 PM   #7 (permalink)
Noisy Crow
Guest
 
Posts: n/a
Originally Posted by Frenchy
The non-working tool used to imput the real username of the old PC and copy the data to new name (yes, it is different ) on a server.

The Restore used to take this folder data and copy to the users login ID folder on the PC.

One command line I wrote looks like this:

robocopy c:\Documents and Settings\Punormana\Application Data\*.* \\snow2srv\Migration\punormana\Application Data /e /zb /r:1 /xo >appdata.LOG

It fails at this point and would be a manual input of the username and subject to typing errors.
Does the orignal PC-->Server copying work?

EDIT:

I see you got it to work.

BTW, for XCOPY: the /C switch forces the copying to continue, even if there are errors.
  Reply With Quote
Old 01-26-06, 11:20 PM   #8 (permalink)
Blogger
 
radimus's Avatar
 
Join Date: Aug 2004
Location: Tampa
Posts: 5,197
Device: AT&T Fuze
Carrier: AT&T US
Thanked 44 Times in 40 Posts

Awards Showcase
Aximsite Silver Reviews Top Notch MyPDA Aximsite Bronze Referrer Aximsite Veteran Staff News Editor Medal Aximsite Active Silver Member Aximsite Active Bronze Member Aximsite Bronze Contributors 
Total Awards: 8

you can also make a bat file to do it and provide a var for it

upload.bat username

this is upload.bat -------------------------------------
xcopy "c:\Documents and Settings\%1\Application Data\*.*" "\\snow2srv\Migration\%1\Application Data" /c /e /d /y ...
-----------------------------------------------------------

the %1 will be replaced by the item on the cmd line when you run the bat file
__________________
Quote:
"Always vote for principle, though you may vote alone, and you may cherish the sweetest reflection that your vote is never lost." -- John Quincy Adams

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
and
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
radimus is offline   Reply With Quote
Old 01-26-06, 11:57 PM   #9 (permalink)
Noisy Crow
Guest
 
Posts: n/a
And if the transfer is being done using the users account the UID is in the environment variables.
  Reply With Quote
Old 01-27-06, 12:04 AM   #10 (permalink)
Aximsite Légende
 
Frenchy's Avatar
Addicted Member
 
Join Date: Jul 2004
Location: Up North
Posts: 23,619
Device: iPhone 3G
Carrier: 10-4
Thanked 7 Times in 7 Posts

Awards Showcase
Platinum Poster Aximsite Veteran Staff Aximsite Active Silver Member Aximsite Silver Contributors Admin Medal Gold Poster Aximsite Gold Referrer Top Notch MyPDA 
Total Awards: 9

Still no go for me. The %1 gives an error in Robocopy. The quotes " " reports errors too. The rest of the command line works. I am reading about Robocopy on teh Internet ATM. This is a new thing for me and I am kinda lost in all this jargon (for me).
__________________
If you get dead silence after breaking the speed of sound, would you be in the darkness after passing the speed of light?
.
Frenchy
Frenchy is offline   Reply With Quote
Old 01-27-06, 12:10 AM   #11 (permalink)
Noisy Crow
Guest
 
Posts: n/a
Quickfix: pitch the quotes and use the eight character DOS names (progra~1 instead of "Program Files" etc.)
  Reply With Quote
Old 01-27-06, 12:15 AM   #12 (permalink)
Aximsite Elite
 
Join Date: Nov 2006
Posts: 3,632
Thanked 0 Times in 0 Posts
Try the /C parm on XCOPY and use the %USERNAME% if it is accessible to you in your environment.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
AKAJohnDoe is offline   Reply With Quote
Old 01-27-06, 12:19 AM   #13 (permalink)
Aximsite Veteran
 
netsyd's Avatar
Uber Member
 
Join Date: Nov 2005
Location: In my cube.
Posts: 1,516
Device: Apple iPhone
Carrier: Cingular
Thanked 0 Times in 0 Posts

Awards Showcase
Aximsite Active Bronze Member 
Total Awards: 1

Frenchy .... not sure this will help very much, but I wrote a script that will move my network share to my PC and vice versa. It utilizes Robocopy, but runs in VBScript, which I know is overkill (long story). The script should be fairly simple to modify to have it request the username and then migrate the files listed.

Here it is... sorry it's not exactly what you need, but it's what I've got :)
Code:
'========================================================================== 
' 
' VBscript Source File -- Created with SAPIEN Technologies Primalscript 4.0 
' 
' NAME: Robocopy.vbs 
' 
' AUTHOR: Brandon Steili , www.netsyd.com 
' DATE : 12/7/2005 
' 
' COMMENT: This script gives you the option of copying your my documents folder to 
' your network drive, or copying your network drive to your my documents folder. 
' The script requires Robocopy, and utilizes the /MIR /SEC switches. The only locations 
' you need to edit to suit your network are in the subfunction at the end of the 
' script. Username is determined automatically. There are a billion products that 
' could do this, but none of them did quite what we wanted... so here it is. 
' 
' 
' ==== Modification dates and users ==== 
' 
' 12/8/05 Initial writing of script 
' 
'========================================================================== 

Dim sourcedir,destinationdir,WshShell,Selection,robocopy,username 



Set WshShell = Wscript.CreateObject("Wscript.Shell") 
robocopy = """C:\Program Files\Resource Kit\robocopy.exe""" 
username = Wshshell.ExpandEnvironmentStrings("%USERNAME%") 

'Notify the user of the intentions 
MsgBox (("** IMPORTANT **") & VbCrLf & VbCrLf & ("The Windows Resource Kit MUST be installed in C:\Program Files\Resource Kit\")) 

'Get the user input for how to process 
Selection = InputBox (("** IMPORTANT **") & VbCrLf & VbCrLf & ("Please select the mirror you wish to process") & VbCrLf & VbCrLf & ( "Press 1-- to move files from local to network") &_ 
VbCrLf & VbCrLf & ("Press 2 -- to move files from network to local") & VbCrLf & VbCrLf & ( "Press 0 -- If you wish to quit") & VbCrLf & VbCrLf & (""), 65, "") 

If Selection = 0 Then 
Wscript.Quit 
Else 
' Call the sub to determine the source and destination directories 
SetFolders 

'Process the files 
WshShell.Run robocopy & " " & """" & sourcedir & """" & " " & """" & destinationdir & """" & " /MIR /SEC", , True 

If Err.Number <> 0 Then 
MsgBox ("** ERROR Received: **" & Err.number) 
Wscript.Quit 
Else 
Err.Clear 
End If 
End If 

MsgBox ("All Done. No Errors recieved.") 


Sub SetFolders 

Select Case Selection 
Case(1) 
sourcedir = "C:\documents and settings\" & username & "\My documents" 
destinationdir = "\SERVERNAME\Users\" & username 

Case(2) 
destinationdir = "C:\documents and settings\" & username & "\My documents" 
sourcedir = "\SERVERNAME\Users\" & username 

Case else 
MsgBox ("Invalid Seleciton. Exiting") 
Wscript.quit 

End Select 
End Sub
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Apple iPhone
O2 XDA Trion - WM6
T-Mobile SDA - WM6

Last edited by netsyd; 06-26-06 at 10:51 AM.
netsyd is offline   Reply With Quote
Old 01-27-06, 12:22 AM   #14 (permalink)
Aximsite Veteran
 
netsyd's Avatar
Uber Member
 
Join Date: Nov 2005
Location: In my cube.
Posts: 1,516
Device: Apple iPhone
Carrier: Cingular
Thanked 0 Times in 0 Posts

Awards Showcase
Aximsite Active Bronze Member 
Total Awards: 1

Note in the above script despite using the code tags it still added some funky spaces (like the declaration of the robocopy variable for example. This is not showing when I try to edit the post...
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Apple iPhone
O2 XDA Trion - WM6
T-Mobile SDA - WM6
netsyd is offline   Reply With Quote
Old 01-27-06, 12:23 AM   #15 (permalink)
Aximsite Légende
 
Frenchy's Avatar
Addicted Member
 
Join Date: Jul 2004
Location: Up North
Posts: 23,619
Device: iPhone 3G
Carrier: 10-4
Thanked 7 Times in 7 Posts

Awards Showcase
Platinum Poster Aximsite Veteran Staff Aximsite Active Silver Member Aximsite Silver Contributors Admin Medal Gold Poster Aximsite Gold Referrer Top Notch MyPDA 
Total Awards: 9

Tried one line and it doesn't work either. Back to the drawing board again :headscrat
__________________
If you get dead silence after breaking the speed of sound, would you be in the darkness after passing the speed of light?
.
Frenchy
Frenchy is offline   Reply With Quote
Reply

Tags
command, line, program, robocopy

Sponsor Ads

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:17 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright © 2003-09 LeckMedia, LLC