Robocopy move files older than Batch : Copy Mar 14, 2018 · robocopy d:\source d:\destination /SEC /S /DCOPY:T # /DCOPY:T : Copy Directory Timestamps. /MINAGE:n :: MINimum file AGE – exclude files newer than n days/date. So, copy, xcopy, robocopy are all possibilities as this is a Windows 2008 or higher server. It says in the documentation for robocopy that a date in yyyymmdd will be accepted. Jul 31, 2020 · There is this option in Robocopy: /maxage: Specifies the maximum file age (to exclude files older than N days or date). Jun 8, 2023 · /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date. Mar 21, 2025 · Maximum file size - exclude files bigger than n bytes. /MAXAGE:n: Maximum file age - exclude files older than n days/date. log rmdir c:\\delete /s /q This script creates a folder called (delete). Hope this helps! Dec 13, 2009 · The following lines can be added to your Batch1. For example, /maxage:1 would exclude the copying of any files older than 1 day. Aug 4, 2015 · Below is a script of how to MOVE files to a folder based on their age: ROBOCOPY <source> <destination> /MOVE /E /MINAGE:<number_of_days> /CREATE /R:1 /W:1 /XD <folders_you_want_to_omit> Sample: Nov 7, 2022 · I am trying to move folders from one server to another that are older (date modified) than August 31, 2021. I use it to delete files from a directory that are older than thirty days. minage:7. My task is to create a script that will move/delete files older than 3 years. I have a public internal share where I’d like to move files from to an archive folder while keeping the same fold… This will list files larger than 32MB. Hence when I ran the robocopy it just copied and I lost all disk space in drive E. * /move /minage:7 DEL C:\Temp\Old\*. prt \new directory. I only want to copy files and folders that are NEWER THAN 01/01/2018. However, it only move the files older than 24 hours from the time I ran the script, rather than the all the files created yesterday. cmd file using something like this: robocopy "c:\Internal folder" "e:\External folder" /S /MOV /MINAGE:1 /IS /R:1 /W:1 and then create a scheduled task that runs that file every few hours. You exclude multiple folders with the /XD switch. (note the MOVE option will fail if any files are open and locked) Examples: Move only files under 60days old robocopy c:\temp c:\temparchive /mov /MAXAGE:60 /copyall /s >c:\temp\FileUnder60daysMoved. Feb 20, 2014 · Need help. So MINAGE will exclude files newer than 20140101 And MAXAGE will exclude files older than 20141231. To robocopy a single file file, specify the source and destination directories immediately followed by the file name in the source. bat in the task scheduler to run it twice a week. LastWriteTime -lt (Get-date). 1) Using ForFiles to delete files over 7 days old: C:\> forfiles /p "C:\source_folder" /s /m *. I would like to move files that move files that have a MODIFIED date 3 years and older. Sounds a bit funny but it works. exe C:\s C:\d /move /e /minage:10 Where: /move says to move instead of copy /e is copy directories including empty ones /minage:10 is to move files older than 10 days. Robocopy normally overwrites those. The robocopy command offers a /minage:MM-DD-YYYY parameter (that's what i'm calling it anyway) that selects files with a minimum age of MM-DD-YYYY. My one complaint is that I never found a way to preserve the folder structure if you were moving files. Apr 15, 2011 · :: Moves dir & files older than 3 days to i:\Destination :: Wildcards acceptable robocopy i:\Source\ i:\Destination\ /MOVE /MIR /MINAGE:3 /ETA :: Removes the destination tree rd /s /q i:\destination There is a long list of options, please do robocopy /? to see them all. This article will help you copy only old files, thereby excluding the newer ones. Move only files under 60days old back robocopy c Aug 29, 2017 · my script is robocopy d:\users\ e:\ /e /mov maxlad:1095 because from what I read it looks like maxlad will move files MODIFIED where as maxage moves files by CREATION date. 2- Take those files and zip them up. In my case, i want to copy all data put into a new folder being created everyday by my colleagues. /xf thumbs. Example 9: Copy only those files that are older/newer than specified days: robocopy C:\Folder1 C:\Backup /E /MINAGE:7. It does exclude files that are older than the specified age, but not their folders. Experimenting with the various switches should get you what you need. ss64. I have a public internal share where I’d like to move files from to an archive folder while keeping the same fold… Jun 16, 2014 · The given answers will only delete files (which admittedly is what is in the title of this post), but here's some code that will first delete all of the files older than 15 days, and then recursively delete any empty directories that may have been left behind. GetFolder(sFolder) Set aFiles = oFolder. robocopy commands can be incorporated into batch files just like copy or xcopy. Then uses robocopy to I am working on a simple script to search a directory for files older than 10 days and copying them to a archive folder and deleting the original. I have a public internal share where I’d like to move files from to an archive folder while keeping the same fold… Mar 4, 2013 · OcalaBob, Robocopy is indeed on topic here. /IS :: Include Same files. Hello Reddit. The original question remains: if you use robocopy to MOVE a lot of folders with subfolders, the subfolder at the deepest level is indeed MOVED, the folders higher up in the tree remain (albeit empty). Aug 17, 2017 · I’m working with Robocopy with the following syntax robocopy E:\Users E:\UsersOld /E /COPYALL /move /MINAGE:1095 Does the MINAGE refer to Create Date or Access Date? My goal is to move files that have not been accessed in 3 years. This command will copy files that have NOT changed in the past 2 days. The folder 1-30 days is the destination of the script You should check out robocopy, it is much more powerful than xcopy. 1. Aug 6, 2020 · Thank you for the tip! Yeah sorry for that, I basically meant “Cut/insert”. I don't want to re-copy any files older than that. rtn \new directory. subfolders: D:\ARCHIVE\folder-day4. XO does "eXclude Older", but it excludes files that are older than the copy in the destination Move files over 14 days old: be aware the MOVE option may fail if any files are open and locked. e. robocopy source destination*. 3- Delete the files that just got Oct 31, 2019 · /MINAGE: n Minimum file age will exclude files which is newer than any days or a specified date. Move or mov, will delete only the data or files that have been copied by robocopy. For example, even if the source has a newer file (based on modified date) than the same file in the destination, I don't want it to be copied. It needs to preserve the folder structure and only move files that fit the above parameters. I need it to move the folders regardless of the file dates. Can’t quite figure the best way to approach this. Dec 3, 2013 · I need to create a scipt that copies all files and folders from \UNCPathA to \UNCPathB but will MOVE any files (retaining folder structure) older than 1 day. /MINAGE:n :: MINimum file AGE - exclude files newer than n days/date. 2. ROBOCOPY C:\source C:\destination /mov /minage:7 del C:\destination /q Move all the files (using /mov, which moves files and then deletes them as opposed to /move which moves whole filetrees which are then deleted) via robocopy to another location, and then execute a delete command on that path and you're all good. Or you want to move to another location to create free space. I know how to do this with multiple RoboCopy scripts, but I want to perform both tasks in a single script if possible (perhaps using PowerShell). how can this be achieved? File sample:sale_20170920 Folder From: c:\Temp Folder To: c:\Backup Here is the original code: Mar 19, 2018 · sRoot = “C:\XXXXXXXXXX” 'Path root to look for files today = Date nMaxFileAge = 14 'Files older than this (in days) will be deleted. Sep 28, 2012 · You can use Robocopy to move files to a temp directory and then delete that temp directory. /MINLAD:n Nov 21, 2010 · Windows 7 include a command line utility named robocopy for bulk file operations. /MAXLAD:n excludes files with a Last Access Date older than n. This will copy all the files, not the subfolders, to the destination location and once completed delete the files from the source location. subfolders: D:\ARCHIVE\folder-day2. log 9/18/2014 z:\test2. So only files from the last 24 hours would be copied in that case. Jan 5, 2018 · I'm working on a batch file to move files older than 10 days from a folder on one volume to another volume in order to have my working documents on a SSD and my archive documents on an HDD. Aug 26, 2021 · This tutorial contains instructions on how you can copy or move, a large set of files to another location, by using ROBOCOPY. Get-ChildItem -Path "C:\Test" -Recurse | Where-Object {$_. I need to be able to easily modify it's directories to fit our needs. exe "D:\AP" "X Aug 19, 2019 · It’s not possible to explicitly copy a single file with robocopy. I want to move any folder (like day1,2,3,4) which is older than 3 days to E:\OLD_ARCHIVE I often copy data from A to B, however I need to know which files are new so I don't have to copy 500gb every time I do this by adding the archive bit to every file copied by robocopy, then I use robocopy again to copy every file out of a directory with the archive bit set into a "new" directory. robocopy c:\\A c:\\B /S /MINAGE:1 /MOV Right, because I'll need what I mention in the previous comment plus this "delete files that are in source and older than distention". The main problem on using Windows command interpreter is no built-in support for time difference calculations. log 9/27/2014 I want Robocopy to look @ the three files on Z, and only copy the files that are in Z as being modified 9/23/2014. /MAXLAD:n: Maximum last access date - exclude files unused since n. How-to: Delete files older than N days. Exemplary: I:\\Examplefolder\\ 1-30 days Folder A Folder B Folder C In the folders are many files. Jun 4, 2017 · The xcopy command unfortunately does not have an option for selecting files older than a certain date, so, also unfortunatly, robocopy is the only option. If a file exists in both the source and the destination I don't want it to be copied. /MINLAD:n :: MINimum Last Access Date - exclude files used since n. exe d:\\Documents\\My Scans (Source) c:\\delete /e /MOVE /MINAGE:7 /LOG+:c:\\robocopy. /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date. * The first row moves all files that are older than seven days in the 'New' folder to the 'Old' folder. May 6, 2011 · Function Move { #Moves all files older than 31 days old from the Source folder to the Target Get-Childitem -Path "E:\source" | Where-Object { $_. I also need it to log everything it did so if something is off i know Sep 10, 2019 · @AdminOfThings is correct, an easier way to do the move is to use Robocopy. This can be easily tested by creating a folder, and then 2 sub-folders. I’ve seen posts with robocopy, but what I have is a folder structure that has numerous folders/subfolders and I’d like something to look through all of the folders and subfolders on a specific drive and move anything older than a certain year to a different drive. Zip files in the archive directory that are older than 1 week and delete files from this directory that are older than 6 months. For example. This command copies only those files that are older than 7 days. Is it possible? So, here are the tasks that I want to perform by using robocopy script: 1- Move files older than x days to another folder. Oct 30, 2012 · Moves all files in E:\DataFiles that are older than 365 days into Z:\Backup\DataFiles. In our example, we say 7 days ago means the file and folders which is older than 7 days we need to copy and create a backup. According the action you want to perform, give one of the corresponding Oct 10, 2022 · If you just want to delete files older than 30 days in C:\FullDir (and all subdirectories), then consider using forfiles instead: forfiles /p "C:\FullDir" /s /d -30 /c "cmd /c del @path" (I would recommend first testing that it does what you want it to do, by using echo instead of del ) I am using this little batch file to archive my files. The updated command should be: RoboCopy. I want to run this script from a different directory (not the directory that has the files). The second row deletes all files in the 'Old' folder Aug 25, 2012 · What I am looking for is an /xs switch. exe are and is very useful to boot. also I have the file elsewhere on F with all times other than access time the same, and with the other one robocopy doesn't require the /FFT for some reason. Eventually I'll dump the . Thanks in advance! /secfix: Fixes file security on all files, even skipped ones /mt:20: Creates 20 threads copies /xo: Excludes older files - if destination file exists and is the same date or newer than the source - don't bother to overwrite it. I now have my differential. You have to specify the date/day you want. XN does "eXclude Newer" files but it excludes files that are newer than the copy in the destination directory. /MIN:n :: MINimum file size – exclude files smaller than n bytes. txt (i dont want certain folders touching) move \Main Directory*. Use /MIN for smaller than 32MB files. subfolders: D:\ARCHIVE\folder-day1. DeleteFiles(sRoot) Function DeleteFiles(ByVal sFolder) Set oFolder = oFileSys. /IT :: Include Tweaked files. /MAXAGE:n :: MAXimum file AGE - exclude files older than Aug 7, 2018 · Hello, I have a program that generates files into a folder in the format name_yyyymmdd. The files older than a year should stay on the original. Files Set aSubFolders = oFolder. /maxlad: <N> Specifies the maximum last access date (excludes files unused since N). txt. log Apr 5, 2017 · How can I move folders older than 3 days to another location? Example: Main folder : D:\ARCHIVE. I am trying to move files where the yyyymmdd is older than 2 year ago to a backup location. Jul 30, 2018 · /move Moves files and directories, and deletes them from the source after they are copied. – Sep 21, 2016 · There are several Windows ports for the *nix find command available, offering switches like -mmin and -mtime that would be useful here, allowing the problem to be solved with a one-liner… Nov 22, 2012 · Hi guys, I am still new on this community and I need your help to build a robocopy script that can be used for do some tasks in one time only. I think I hacked a robocopy script that will move and preserve the folder structure. SubFolders. It will just list what it will do without actually copying any files. Aug 17, 2016 · By default, Robocopy skips copying existing files if the specific metadata of the files match then those files will be skipped from the "file" copy operation (/COPY:DAT). The /XN switch tells Robocopy to exclude existing files that are newer than the copy in the source directory. (If n < 1900 then n = no of days, else n = YYYYMMDD date). May 3, 2013 · I have one folder A and have another folder B in the same drive E: I need to move all the content from folder A which are more than 2 years old to folder B. Jul 21, 2018 · /MAXAGE:n : MAXimum file AGE - exclude files older than n days/date. Use the /l switch to test robocopy. Jun 30, 2015 · So i modified it to the move command and it only took the files from the root of the directory. Reply reply Jul 9, 2024 · Exclude files bigger than a given size. Technically it did what was told, but not exactly I want. To select only newer files use /MAXAGE. /maxage: <N> Specifies the maximum file age (to exclude files older than N days or date). * /mov /minlad:10 move all files edited from 2010 to 2017 Aug 20 to another location if the file was created in 2016 Dec 25, but /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date. g. /MINLAD:n excludes files with a Last Access Date newer than n. I just thought using /MOV will “delete” all files but not the folder. Is that possible? We have multiple file servers where I work containing terabytes and terabytes worth of files. Yes, first move the files and then delete older than 14 days. Maybe in this case Robocopy wouldn't move the entire folder but only the older files - is that how it works? Oct 20, 2018 · Outputs job file to: C:\ProgramData\Scripts\Robocopy\File-Sync. db" files (path) you can use wild characters here (ei: *. Source: Robocopy Complete Reference; How to Batch Copy or Move Files Using ROBOCOPY. com Robocopy "Robust File Copy" - Windows CMD - SS64. /MAXLAD:n :: MAXimum Last Access Date - exclude files unused since n. :: Move the files robocopy P:\Folder1 Q:\Folder2 /move /e /minage:60 :: Delete empty folders q: cd Folder2 for /f "tokens=*" %%d in ('dir /ad/b/s ^| sort /R') do rd "%%d" pause >nul However, the problem is that lots of my folders contain files with different ages. Open PowerShell or Command Prompt as Administrator. /MIN:n: Minimum file size - exclude files smaller than n bytes. I suggest that you read the found questions and answers. 3. robocopy c:\Backup_Files g:\folder01 /move /e Sep 16, 2019 · I looked at the other forums on here that had similar issues, but none of those solutions worked for me. By default Robocopy will only copy a file if the source and destination have different time stamps or different file sizes. log 9/23/2014 z:\test3. If n >= 1900, n must be a date in the form YYYYMMDD Below is my 1st ROBOCOPY command in script. I have the following parameters, but just copied still compares the files dates and moves only older files. If you do use this, make sure that you are saving this to a more permanent and accessible location than C:\temp. If n < 1900, n is taken to be a time span in days. Exclude files newer than a I thought this was one of the first things that a novice PowerSheller learned. Backup a Server: The script below copies data from FileServ1 to FileServ2, the destination holds a full mirror along with file security info. I have search everywhere and I was unable to find a solution. I want to MOVE files and folders older then 365 days from C:\\test to D:\\test while preserving the directory structure. subfolders: D:\ARCHIVE\folder-day3. When I run the script, it copies over folders that are older than the /MAXAGE specified. AddDays(-31)} | Move-Item -destination "C:\Dumps" Here's a screenshot: Jan 31, 2022 · 1) With Robocopy, you could use /maxage switch. robocopy <source> <destination> * /XO <file-from-an-hour-ago> <filespec-to-copy> should do the trick, with a bit of tweaking. I’ve seen a few possible solutions, but none of them have been a perfect fit - sorry for the long read but the criteria are somewhat exacting. * /mov /minage:10 move all files created from 2010 to 2017 Aug 20 to another location robocopy source destination*. The script always says everything Aug 1, 2018 · Nice. /xx: Instead of copying the files, we can move them using the /move switch. The last action is to remove the trash folder containing all found old files which. So the copy function needs to copy new files (newer than a year) but also delete any files older than a year on the laptop. mp3) Apr 13, 2020 · The final element of this command is a txt log file that records a list of all the files/paths moved. which is more suited? robocopy , move, forfiles, powershell ? examples please? Jun 24, 2013 · Files all from same directory and should move (meant copy and delete from source directory). The main batch file/cmd topic for all "older than" questions is: Batch file to delete files older than N days. Exclude files older than a given age. However, you can robocopy single file with the right filtering which you’ll learn about below. so far I’ve got: move \Main Directory /EXCLUDE:list-of-excluded-files. * /S /MINAGE:days Move files older than 2 days to from the main directory (Jason) to an archive directory. db: Excludes "thumbs. why I needed in hh:mm ways, when first server copy may takes few minutes and when it go for second server copy, there might be more files been created and that case second server of course have more files than the first server to copy May 7, 2007 · /MAX:n :: MAXimum file size – exclude files bigger than n bytes. PowerShell is great for moving or deleting files older than X days. ROBOCOPY "C:\MyFiles\*. Mar 17, 2025 · To move files and subdirectories, excluding empty directories, from the "Records" folder to the "Backup" folder on drive "D", and exclude files older than 7 days, type: robocopy C:\Users\Admin\Records D:\Backup /S /MAXAGE:7 /MOV /LOG:C:\Logs\Backup. To move files only (delete from source after copying) robocopy from_folder to_folder files_to_copy /MOV To move files and directories (delete from source after copying) robocopy from_folder to_folder files_to_copy /MOVE Robocopy will than move (not copy!) all desired files (correct extension and modified time stamp older than 365 days) to that trash folder. Basically I need something that we can schedule every night to look at drive y and move any files older than 5 days to drive z. More precisely the script searches files and folders which are older than 30 days and move them to another folder. So, in your instance, you'll use. Use copy or PowerShell’s Copy-Item for that. If you want 20140101-20141231, try swapping the values between MINAGE and MAXAGE Mar 5, 2020 · I’m looking to archive files over than a certain year. Help! /XO excludes existing files older than the copy in the source directory. Apr 28, 2013 · The /FFT works - doesn't say one file is older/newer. Jun 22, 2018 · Quick need: Within a SQL Agent job step, I am looking for a way to copy files newer than 60 minutes "ago" to another server. For Each file in aFiles Oct 11, 2011 · I have a project to review and disposition all files on a file server with access dates older that 31Dec05. bat file to move and delete files older than seven days: ROBOCOPY C:\Temp\New C:\Temp\Old *. /MAXLAD:n :: MAXimum Last Access Date – exclude files unused since n. robocopy "\\source\Folder1" "\\dest\Folder2" /E /ZB /SECFIX /COPYALL Nov 1, 2022 · When you need to move files from one location to another, then you can use the /mov parameter in Robocopy. /MIN:n: MINimum file size - exclude files smaller than n bytes. It's an external program just like findstr and find. LastWriteTime -lt Jun 6, 2013 · check three directories on the D:\ for files older than 30 days; If there are files on there older than 30 days then move them to E:\ using the exact directory structure (this is to backup old log files to retain disc space) Mar 22, 2017 · This script should look in specific folders, check the creation time of the files within that folder, and if the files are all older than 2 minutes, go ahead and copy the files to another drive. pdf \new directory. (name zipped file with the date stamp). Jan 28, 2016 · I have a folder name C:\\TEST which have several hundreds sub folders in it. This will ensure that Robocopy only overwrites files that are older than the copy in the source directory. Using staging folder then move-item might works. a file is generated each day. I was tasked to move files from one drive (drive y) to another drive (z). The data usually contain files older than the date they are copied into. So to archive this the command will be . Why copy or move older files? When it comes to dealing with old files, most probably, you wish to move them to another backup device to archive them. You can drive the whole thing using a PS script. Aug 31, 2017 · I’ve seen a few posts related to this topic, but want to clarify a couple of things about Robocopy first. Sep 9, 2008 · Run the following commands:. . You need to create a . My code also uses the -Force option to delete hidden and read-only files as well. Aug 7, 2023 · The command you are using is correct, but you are missing the /XN switch. /MAXAGE:n: MAXimum file AGE - exclude files older than n days/date. I will try out robocopy XC and see if that works. /MINAGE:n: Minimum file age - exclude files newer than n days/date. Feb 21, 2019 · Not only can you copy/move files from one place to another, you can also sync folders destinations, too. /MINAGE:n : MINimum file AGE - exclude files newer than n days/date. Using Powershell so far. Curious to know how many files were moved (older than 14 days) that would warrant the usage of robocopy over regular move-item (aside from logs). com. Jun 25, 2014 · Hi all, does anyone have a good robocopy script to move files older than a specific date using the /MINAGE switch and also the /MINLAD? I have to move a truck load of files older that 7 years or not accessed in the last 3 years. z:\test1. Mar 30, 2015 · This will move everything older than 30 days . If they make a change to their file, that will update the timestamp. /MAXAGE:n :: MAXimum file AGE – exclude files older than n days/date. I am working on the copy part now. 2002 use robocopy to move, eg, the files in 1000 with a last update date in 2002 to 1000. /MAXAGE:n : MAXimum file AGE - exclude files older than n days/date. ROBOCOPY C:\work C:\destination /move /minage:14. You can also use another command, combined with this log file to restore all the files moved to the source path. This is actually backwards. Aug 29, 2018 · Good day! I have a question about robocopy: I wrote a script lately for move files and folders into another specific folder. rcj; /xo Source directory files older than the destination are excluded from the copy. Two If I was doing this with huge file structures, I would create target folders with dates, eg, 1000. You can easily move files with /MOV or /MOVE. mkdir c:\\delete c:\\robocopy. As i understand it (summed up in my answer) is he wants a backup of the photo-directory on his laptop with only files newer than a year. – Apr 7, 2022 · Excludes existing files older than the copy in the source directory. in my case the data that are the same date as the destination will not copy by robocopy and thus will not get deleted from the Aug 4, 2016 · I plan to use robocopy to move files and folders from a directory on a server to a directory on a hard drive, using the following command, robocopy [source] [destination] /e /move /xo In the event Jul 3, 2014 · hi guys hope you all can help, been handed this task and finding it rather difficult to figure out need this scrip to delete folders older then 7 days, this needs to be run everyday. And by newer, I do mean based off of the Last Aug 30, 2017 · I’ve seen a few posts related to this topic, but want to clarify a couple of things about Robocopy first. I’m trying to come up with a way to automatically enforce our policy of deleting data from our FTP Aug 30, 2017 · I’ve seen a few posts related to this topic, but want to clarify a couple of things about Robocopy first. So if today is 17/12/24 I wish to copy all files from 16/12/24 even if the age is less than 24 hours. The criteria is file name only, regardless of modified day, size, etc. I'll let you know! The reason I want it to re-copy files from the source even if the source file is older is because these files reside on the employee's computer. Moving/deleting the files aside, just "getting" the files is an issue. Would anyone know a powershell command which will move files that are older than 3 years within a folder structure to another destination either keeping the folder structure or, if the folder structure has already been copied using robocopy, moving the files to that folder structure, preserving the structure in the process. /minage: <N> Specifies the minimum file age (exclude files newer than N days or date). So none would be selected. Robocopy, is a command-line directory/file replication command. /MINAGE:n: MINimum file AGE - exclude file newer than n days/date. ` So your code should be: robocopy command to move file based on created date. /MAX:n :: MAXimum file size - exclude files bigger than n bytes. Aug 30, 2017 · I hope this helps (file server created in 2010…today 2017 Aug 30)…I only want to keep 10 days of files on my server. I hope someone here will have a better idea. : Robocopy. Thank you guys. 2002 Use 7z. Skips file copy if last write time, file name, and file size match; Copies file if last write time, file name, or file sizes don't match Feb 20, 2014 · OK, I’ve been beating my head against the wall for a couple hours today trying to figure this out. Jan 5, 2010 · Select files based on their Last Accessed Dates. Exclude files smaller than a given size. robocopy %varSourceArchives% %varTargetArchivesFolder% /MIR /COPYALL /DCOPY:T /MOV /MINAGE:1. Robocopy Defaults. Though both M:\ and F:\ are NTFS. Regards, Golden Dec 17, 2024 · Hi, I’m trying to move files created yesterday from folder A to folder B The issue is that my command doesn’t copy files if the time stamp is bellow 24 hours. When I do the copy it copies the files to the destination folder without creating the subfolders. * /c "cmd /c Del @path" /d -7 Dec 20, 2016 · Related: Batch file to delete files older than N days; query whether @isdir is TRUE within the command line after the /C switch of forfiles to operate on directories rather than files, and use rmdir rather than del to actually delete directories My goal is to move files and folders that are over 18months old to cold storage folder run as a scheduled Task. robocopy [sourcefolder] [destinationfolder] *. ROBOCOPY "C:\MyFiles" "C:\OldFiles" /move /minage:7 /s Your post isn't clear if you only want this to be targetting . So if I ran the command at 10AM only files that are older than 24 hours will be copied. Dec 12, 2018 · I have made a batch file to robocopy /MOVE files with xxxx* in the file name to a temp folder, then a second command using forfiles to delete any files in the original directory older than -xx days old, then using the robocopy /move to move all the other files back to the original directory. Any help would be greatly appreciated. txt files or not, if so then use . Jan 27, 2017 · This script should look in specific folders, check the creation time of the files within that folder, and if the files are all older than 2 minutes, go ahead and copy the files to another drive. txt" "C:\OldFiles" /move /minage:7 /s Feb 20, 2015 · Robocopy will do the job, assuming you can specify a file from the previous hour's copy as a timestamp -- something like. exe to zip these structures. Robocopy is much faster than powershell to do the move. move \Main Directory*. 2) If you know the specific names of the files to be copied and if they are the same every time, simply specify the specific names in the robocopy command. Use the -Recurse option on the Get-ChildItem command to get through to the files in the sub folders and then move each individually by piping the collection to Move-Item. /MIN:n :: MINimum file size - exclude files smaller than n bytes. I want to do the following: 1) Generate a list (including path) of all files that meet the requirements 2) Export that list to a text file (CSV would be great) that I can circulate to my users with deadlines for review and disposition 3) Move the files to another network location at the The /MT: option has nothing to do with the date, it is the number of threads used by robocopy. We have no system in place currently for archiving/deleting stale data. Look to the syntax/usage of robocopy: /MAXAGE:n :: MAXimum file AGE - exclude files older than n days/date. Inside one of the sub-folders, I create a New text document (so it is less than 2 minutes old). There are several ways to do this. X is my backup and Z is the file server. Sep 18, 2014 · If the destination file has an older or newer date, don't touch it. Any help will be appreciate. Better would be using PowerShell. xrgesfxolaiqiuhptrbtksgljogbylonbmwjpzynuassbnlzllwnrjvjrvihoaturmvmdspegprlki