Skip to main content

Questions tagged [robocopy]

Robocopy (or "Robust File Copy") is a command-line directory replication command.

Filter by
Sorted by
Tagged with
1 vote
2 answers
4k views

Deleting Files Older than 30 Days with Robocopy

I want to delete files older than 30 days via Robocopy. Robocopy C:\EmptyDir C:\FullDir /mir /MT /R:0 /W:0
Cell-o's user avatar
  • 421
0 votes
2 answers
2k views

Robocopy: Copy all files in subdirectories within parent folder to a new folder

I've done some googling and although this seems to be a pretty straightforward process I have been unable to find code that works. I have a folder with several sub-folders and sub-folders within them ...
Hammy's user avatar
  • 3
0 votes
0 answers
291 views

How to copy files from one drive to another while maintaining folder structure

I used an old program (rich copy) to copy files from one drive to another. The files have been created, as well as the directory structure, but due to some long file names and directory names some ...
Ralph-IT-guy's user avatar
1 vote
3 answers
476 views

Incremental copy of log file content

I have a couple of log-files, growing one line at a time, as log files do. The files are available via SMB network share. I want to periodically copy these files. Since the network is rather slow and ...
HugoRune's user avatar
  • 748
0 votes
0 answers
372 views

How to reverse the effect of robocopy junction link command used to change the directory of ProgramData from C to D?

I recently followed the following advise to free up space on my C Drive, however, I wasn't able to delete the ProgramData folder after executing the command below. Any idea how I can reverse the ...
ISs's user avatar
  • 1
1 vote
2 answers
6k views

How to overwrite files using robocopy regardless of their last change date

I want my PowerShell script to take a backup of $destination directory, in $backup directory, but the newly created backup directory should be named $destination-{yyyy-dd-mm} where 'yyyy-dd-mm' is ...
user419022's user avatar
0 votes
1 answer
135 views

Robocopy Skipping All files Targeted

Good Afternoon, I'm attempting to use robocopy with Powershell to recursively grab all files from sub-directories and moving them to one "root" directory. I tried doing this with copy-item ...
MrMachoman86's user avatar
1 vote
1 answer
2k views

Robocopy script to copy certain file names with space inbetween

I use the script to copy certain files with file name having space in between. I tried serveral options but still in vain. Please help robocopy "Z:\Software\Microsoft Office" %userprofile%\...
VB88's user avatar
  • 423
3 votes
1 answer
716 views

Robocopy from network drive doesn't skip duplicates

This is my robocopy line: robocopy "\\network\Document\Migration" D:\Migration /S As described here robocopy should skip files that have the same size, date and name. First copy from ...
Samuel Gfeller's user avatar
0 votes
1 answer
852 views

Using Robocopy to copy files based on a word in the file name

So ok, I'm looking for a solution to scan a hard drive. And look for folders in that hard drive that have #ARCHIVE#, and move said folders to a \nas\archive\ I know you can use Robocopy to copy files ...
Reinhard Zapfe's user avatar
3 votes
1 answer
2k views

Can LastAccessTime be set to an old timestamp using PowerShell?

I am using PowerShell to create test files for testing the output of Robocopy logs. To get different combinations of newer and older files, I am setting the file timestamps in the source and ...
Jim's user avatar
  • 543
0 votes
0 answers
311 views

Robocopy using a NO-IP address

I think I was unluck to explain what I need on my 2 first posts. Let's try one more time... Just need to sync a folder from a computer in a different city. But I don't know how to tell robocopy to use ...
BHi's user avatar
  • 1
0 votes
0 answers
1k views

Powershell New-PSDrive from remote computer

I'm here again with one more question. As stated here, I sucessfully connected two servers to copy a lot of files. But the copy won't worked at all. It returns a lot of errors on files and folders ...
BHi's user avatar
  • 1
1 vote
1 answer
3k views

Excluding multiple directories not working as expected with robocopy

I'm running the command: robocopy /E /XJD E: D: /XD 'E:\$RECYCLE.BIN\' 'E:\System Volume Information\' Which runs for a while but then gets stuck at: 2022/05/21 21:39:04 ERROR 5 (0x00000005) Copying ...
Ian Newson's user avatar
0 votes
1 answer
737 views

Any way to remove the hidden attribute when robocopying from the root folder?

When I copy from the system root drive like this: robocopy D: C:\users\localUser\pictures\CPics *.jpg *.jpeg *.png *.gif /e /MT:4 /R:0 /NP /SL /SJ /NFL /NDL /XA:o /B /LOG:"C:\Users\anton\...
Antonio23249's user avatar
  • 1,031
0 votes
1 answer
571 views

Robocopy destination folder not specified

I want to make a backup copy of an entire drive to a folder in an external drive but robocopy doesn't "see" the specified destination folder. The idea is to update all the files and add the ...
E_Blue's user avatar
  • 723
0 votes
0 answers
410 views

Network share access denied after STIG/CIS hardening in windows

I have one windows server from where I was running robocopy and it was working. The source was a network share from where I was copying some files to this windows server. After implementing CIS/STIG ...
user3847894's user avatar
1 vote
2 answers
3k views

Any way to copy only all the files in a folder, without the folders?

Any way to copy only all the files in a folder, without the folders? I tried these to no avail (they copy folders too): ROBOCOPY D:\SAMPLE D:\SAMPLE2 /IF *.* /E ROBOCOPY D:\SAMPLE D:\SAMPLE2 *.* /E ...
Antonio23249's user avatar
  • 1,031
0 votes
1 answer
376 views

Restore file modification time from backup

Due to some careless copy/zip/unzip operations, all files in a folder and its subfolders had their last-modified time updated. I would like to restore the correct file timestamp from an older backup. ...
HugoRune's user avatar
  • 748
2 votes
2 answers
2k views

Is there Windows copy command that mimic Unix `cp -r` behavior?

I don't know how to name this behavior vividly, just call it loyalcopy. Two figures will illustrate it clearly. I'd like to issue two commands to copy two filesystem nodes (regardless it is a file ...
Jimm Chen's user avatar
  • 6,014
1 vote
0 answers
1k views

Purpose of xcopy over robocopy

From what I've found online, robocopy seems to be xcopy with more features; are there any scenarios where someone would want to use xcopy over robocopy?
Meester Moo's user avatar
0 votes
0 answers
2k views

Robocopy only copy folders modified in last 7 days. working on C drive, not on server?

I am trying to create a robocopy program which runs every Sunday and pulls in the last 7 days of folders (and its sub-folders). This is because the folder stores years worth of data so I only want to ...
knowlec's user avatar
0 votes
1 answer
2k views

Can Robocopy sync Files in a Directory between two pcs, Modifications of files on both pcs, but want to keep newest modifications/files synced

So I am trying to keep a Minecraft Game Save Folder that is located in both PC A and PC B in sync. PC A and PC B will both access/modify the contents of the files in this folder periodically. I would ...
xenosaga01's user avatar
0 votes
1 answer
2k views

Robocopy error: ERROR 5 (0x00000005) Changing File Attributes

Ugh. I've been using this command for years and am now getting this error: robocopy m:\ e:\ /MIR /MT /R:1 /W:10 /XD m:$RECYCLE.BIN m:\temp\Backup m:.TemporaryItems "m:\System Volume Information&...
Dan Marcoux's user avatar
0 votes
1 answer
5k views

How can I merge multiple folders and files to a new single folder?

I have a folder named SCENERY on drive F (F:\SCENERY). It contains several folders: A, B, C... etc. I would like to merge the contents of A, B, C... etc to another folder on drive F named BASEFILES (F:...
DaveM's user avatar
  • 1
0 votes
0 answers
751 views

Should my PC go to sleep while robocopying?

I noticed my PC goes to sleep while robocopying, so I' having to set the timer to a long time in Settings > Power&Sleep > Sleep. I checked with the powercfg -requests command it it seems to ...
Antonio23249's user avatar
  • 1,031
0 votes
1 answer
901 views

Why does Robocopy skip a changed file if file length and file date are the same?

I've been using Robocopy for a while to create a (quick) backup of my disks. The exact command I use is robocopy /MIR /R:0 sourcedrive:\ targetdrive:\sourcedrivename . This should create an exact ...
Deekay's user avatar
  • 177
2 votes
1 answer
3k views

Robocopy, what's the total time to run the copy?

Robocopy shows what seems to be the time it took to do the copy...but it shows two, which of the two is the right one?
Antonio23249's user avatar
  • 1,031
1 vote
0 answers
46 views

Why does Windows Explorer change the 'Folder Modify Time' when first accessing a folder after a robocopy?

I am attempting to use Robocopy to mirror a directory structure (/e) and keep created/modified/accessed times. This should be fairly simple with '/copy:DAT /dcopy:DAT' and appears to preserve the ...
Chuu's user avatar
  • 763
1 vote
1 answer
2k views

Robocopy behaviour (user profile folder) [duplicate]

I'm copying with robocopy the folder C:\users to D:\Backups with the following command: robocopy "C:\users" "D:\Backups" /e /b /copyall /MT:32 /r:0 /w:0 Instead of copying the ...
someone's user avatar
  • 33
1 vote
2 answers
2k views

Robocopy created hidden directory at destination

I can't see the directory "Backup" in Windows Explorer, although I can navigate to it. The same is true for PowerShell. When I go to the root of the directory Dad and type ls I don't see it ...
Daniel Penrod's user avatar
0 votes
0 answers
4k views

Is it possible for robocopy to always create destination structure if it's missing in monitor mode?

Setup: Several measurement devices are wired to a local computer. A python application runs on this computer to relay commands to the measurement devices. Measurement devices produce and store ...
KHX's user avatar
  • 1
0 votes
1 answer
197 views

Robocopy occasionally "forgets" to copy files

I use robocopy to copy modified files between my development machine and a server. Source machine is Windows 10. Target machine is Windows Server 2016 Standard. This is the command and parameters I ...
Grimm's user avatar
  • 121
1 vote
1 answer
232 views

does robocopy kill files while mirroring if read error?

my params is /mir /copyall /dcopy:t /z /v /tee /eta /unilog+ /mt:32 /r:3 /w:30 for example, some copying finishes ok so, is read error "equal" no-file? will robocopy delete file at ...
Seriy_A's user avatar
  • 11
1 vote
0 answers
1k views

Robocopy Error 53 when not logged in. When logged in, Robocopy runs successfully

We run a nightly scheduled task that copies files from a local drive to a network share. When I'm remoted in to this machine using any account, Robocopy runs fine. When I'm not logged in, Robocopy ...
OSeRAcKB's user avatar
0 votes
1 answer
4k views

Using Robocopy for incremental backup to OneDrive connected as network share

I have OneDrive set up as a network share rather than syncing the local OneDrive folder. I'm trying to use robocopy on Windows 10 in a batch script which will run as a daily scheduled task to "...
Shawn's user avatar
  • 3
0 votes
1 answer
5k views

Why does robocopy fail this folder?

I have this weird folder in my windows 10 system drive, this doesn't seem to be a junction point so I don't know what it is, please see picture. I am trying to copy it with robocopy from an admin CLI ...
Antonio23249's user avatar
  • 1,031
0 votes
1 answer
1k views

Is there any way to disallow Robocopy to download files from OneDrive to a local backup?

I hope you can help me. I currently use Robocopy to back up my OneDrive files to a local hard drive with the following command: robocopy Location1 Location2 /MIR /W:0 /R:1 /REG. It works great. ...
Ale500x's user avatar
1 vote
2 answers
3k views

Robocopy issues with cloud files

I’d like Robocopy to copy all useful data from a Windows system drive, but, for some reason, robocopy doesn't know how to tell apart certain OneDrive files (I guess Google drive and iCloud may have ...
Antonio23249's user avatar
  • 1,031
0 votes
1 answer
103 views

Robocopy command isn't backing up, is this command valid?

I'm trying to use Robocopy to incrementally back-up my project every 15 minutes, only if there are changes. I'm using Windows Task Scheduler to start the .bat file at start-up, and because I don't ...
TheNomadicAspie's user avatar
0 votes
1 answer
355 views

robocopy a specific directory and its contents but not the files on the same directory-depth

I have a folder structure like this: R:\TOPFOLDER ├───Folder_1 │ │ other File.txt │ │ │ ├───!Downloads │ └───other_Folder ├───Folder_2 │ │ other File.txt │ │ │ ├───!Downloads │ ...
Phil's user avatar
  • 104
0 votes
2 answers
866 views

Can I recover Onedrive files from an old hard drive?

I need to recover some files from an old hard drive. They are in the Onedrive folder and seem to be offline (there’s a cross icon on them and show the O attribute when I do “attrib filename” with any ...
Antonio23249's user avatar
  • 1,031
0 votes
0 answers
97 views

Is there a way to tell robocopy to report in its log how many files it has overwritten?

I'm using Robocopy with the /MIR option to backup some directories periodically, and I would like it to output a log in which the summary can tell me how many files were overwritten (not just copied ...
Mike's user avatar
  • 1
0 votes
0 answers
171 views

Any Robocopy GUI that can run from CMD in WinRE?

Please correct me if I'm wrong, I wish I were: I'd like to use Robocopy from Command Prompt in the Windows 10 Recovery Environment (by booting to the WinRE and opening Command Prompt). I learnt there'...
Antonio23249's user avatar
  • 1,031
0 votes
1 answer
1k views

Use robocopy to exclude directories containing a file

I'm using robocopy in a batch script to back up all of my files onto an external drive, but I want to exclude any folders that contain (directly) a file called ".nosync", so I can avoid ...
Nathan D'Silva's user avatar
0 votes
0 answers
30 views

How to improve remote backup

I need to backup a large file (>20GB) onto a shared folder through a wired LAN. I have used ROBOCOPY with no buffer (/J) and multithreaded (/MT:64). Nevertheless task manager measures no more than ...
Dario Corrada's user avatar
1 vote
1 answer
3k views

ROBOCOPY command gives me error if owner is set to group instead of user

I want to copy folder structure with permissions using this command: ROBOCOPY "source" "destination" /E /copy:DATSO /NP /MT. It works only if source folder is owned by the user ...
CHEWKOK's user avatar
  • 35
0 votes
0 answers
907 views

Use robocopy to copy without attributes for files and directories

I'm trying to run robocopy to copy data but not copying attributes (timestamps are ok). My first thought was to run with these switches: /copy:dt /dcopy:t The way I interpret the documentation, those ...
ProfessionalNature's user avatar
2 votes
0 answers
774 views

Why does calculating folder sizes with Robocopy.exe give me different results compared to Get-ChildItem?

I have this Function that takes a path input, and gives you the size of it. There are 3 different options you can choose from which are: 'GCI' - Get-ChildItem 'DIR' - CMD's DIR command 'ROBO' - ...
Abraham Zinala's user avatar
0 votes
0 answers
206 views

Robocopy reporting wrong file count on log summary

I’m copying a folder with robocopy and it’s copying-over just fine. However, the file count reported at bottom is wrong (see picture) To make sure it copied fine, I opened the log with Word and ...
Antonio23249's user avatar
  • 1,031

1
2
3 4 5
11