RoboCopy Syntax
-
In playing around with RoboCopy, I’m seeing what I can do with it, as a replacement for copy or xcopy.
I’ve run into a short wall in that I want to be able to copy a set list of folders/sub folders to a single folder.
When I tried this, it failed and I’m in the process of sorting it out. I imagine it is a simple issue with my syntax.
RoboCopy c:\users\gjacob\documents\ \\server1\department\g.jacob\_backup\ /e /zb
The goal:
Copy specific folders to the server as part of a profile backup -
Maybe not specific to what you need but this is a ps script I use to copy specific files I want. I believe it would work for folders also with the proper switches on the robocopy command.
I will uncomment the "/L" line as a test to make sure I will get what I want before executing the file line.
$files="C:\temp\file_list.txt" $SORC="C:\sorcfolder\temp\sorcfolder" $DEST="F:\destfolder\temp\desfolder" #Externally set input value as string [string[]] $arrayfromfile= @(Get-Content $files) #& robocopy /L $SORC $DEST $arrayfromfile #& robocopy $SORC $DEST $arrayfromfile
-
I feel that I’ve made decent progress on the script, that said, I’ve run into a snag trying to grab Google Chrome User default folder:
RoboCopy “%src%\appdata\local\google\chrome\user data\default\” %dst%\chromeProfile\” /xa:sh /xjd /r:5 /w:5
I can’t seem to isolate the issue, this is almost the same syntax I am using to copy the profile.
-
@gjacobse said in RoboCopy Syntax:
I’ve run into a snag trying to grab Google Chrome User default folder:
Don't use Chrome!
-
@gjacobse said in RoboCopy Syntax:
I feel that I’ve made decent progress on the script, that said, I’ve run into a snag trying to grab Google Chrome User default folder:
RoboCopy “%src%\appdata\local\google\chrome\user data\default\” %dst%\chromeProfile\” /xa:sh /xjd /r:5 /w:5
I can’t seem to isolate the issue, this is almost the same syntax I am using to copy the profile.
Before you copy make sure Chrome processes is not running first. And last time I check, saved passwords doesn’t work when copying the chrome profile. I think Firefox is the only one that you can backup the profile without losing your saved passwords.
-
@black3dynamite said in RoboCopy Syntax:
@gjacobse said in RoboCopy Syntax:
I feel that I’ve made decent progress on the script, that said, I’ve run into a snag trying to grab Google Chrome User default folder:
RoboCopy “%src%\appdata\local\google\chrome\user data\default\” %dst%\chromeProfile\” /xa:sh /xjd /r:5 /w:5
I can’t seem to isolate the issue, this is almost the same syntax I am using to copy the profile.
Before you copy make sure Chrome processes is not running first. And last time I check, saved passwords doesn’t work when copying the chrome profile. I think Firefox is the only one that you can backup the profile without losing your saved passwords.
Good point, and I did run into that during a manual copy. I'm pretty sure that it would be a simple matter to added kill process - but I'll have to research that to see if it can be done by process name, not process number.
Yes - I'll do that. Seems easy enough.