Sort Folders and files and copy to external hard drive

Discussion in 'Scripting' started by ramg1967, Aug 13, 2016.

  1. ramg1967

    ramg1967 MDL Member

    Sep 13, 2012
    Hi - I have least knowledge with scripting. I have a request from one of our user at work. They have a lot of folders and files on the network drive which is close to 2TB. They want to do a clean by copying all folders and files that were last modified as of 2009.

    I looked at the folders and tried to sort by date but that will not work because they have a lot of sub folders and sub folders and files within each folders. It will be a tedious task to go through all folders and files looking for last modified as of 2009. Can this be done with a script that can scan the network drive where they have the folders and files and look for last modified date of 2009 and then copy those folders and files to external hard drive.

    Here is an example of the folder structure on the network drive:

    AR - Root Folder
    Inside the Root Folder there are a number of sub folders
    Inside the number of sub folders there are number of files with various last modified dates
    I would like to copy only those folders, sub folders and files that were last modified as of 2009 to external hard drive.

    Any help on the above would be appreciated.

    I have googled and found few scripts in powershell but don't know what to modify to meet above requirement. I can share the PS script, if anybody want to have a look,



    P.s: I am willing to pay for your time in helping with this request.
  2. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    I think forfiles or robocopy can do the job.
    Maybe I will/can take a more specific look later.

    2500 is just a number of days. just a rough number.

    Robocopy /minage:2500
    forfiles /D -2500
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...