recursively search C: for specific file-type type then copy w/Path Solved

Page 1 of 2 12 LastLast
  1.    #1

    recursively search C: for specific file-type type then copy w/Path

    Pretty much what it says in the Header. I am sure this can be done using the correct switched in several tools like robocopy or even X-Copy but so far copying the file including its full path to another location is not working properly for me.
    I think i have the recursive part working but the files i am looking for are all in hidden or system folders. To be specific, all the *.ACL files. I would like to have a copy of each located in its current full path in another folder for a project I am working on. I have a number of tools that can easily find them all. Ultrasearch is great for that. But nothing allows me to copy all 30 of them with their full paths to another folder.
      My ComputerSystem Spec

  2. thomaseg1's Avatar
    Posts : 361
    Windows 10 Professional (x64) Version 1809

    Have you tried a program called "search everything" or just "everything"
    its listed under other on

    Ninite - Install or Update Multiple Apps at Once
      My ComputersSystem Spec

  3. Ztruker's Avatar
    Posts : 7,808
    Windows 10 Pro X64 1809 17763.437

    You copy files, you don't copy paths, so your question doesn't really make sense, at least not to me.
    You can create a list of files with their full paths and save that as a .txt or.csv file but that's all I can think of that you can do to preserve the path.
      My ComputersSystem Spec

  4.    #4

    It Kills e that this is something i have done before but simply cannot remember the correct steps. If they ever meed a volunteer to be the first one to have the consciousness downloadable into a computer I want to know where to sign up/
    I will post back here shortly witty the code
      My ComputerSystem Spec

  5.    #5

    It is done with robocopy.

    Let's say you want to copy all *acl files in c:\ with path to D:\ACL:

    robocopy c:\ d:\ACL *.acl /s /ndl /xj

    c:\ = source
    d:\ACL = destination
    *.acl = Pattern of files to copy
    /s = Include subfolders except empty ones
    /ndl = No Directory Listing
    /xj = Exclude Junctions

    Let's say you don't want to copy you only want a listing with all *acl files and save it in a text file:
    robocopy c:\ D:\ACL *.acl /njh /njs /np /nc /ns /s /ndl /xj /fp /l /log:D:\log\log.txt
    /njh = No Job Header
    /njs = No Job Summary
    /np = No Progress
    /nc = No classes
    /ns = No size
    /fp = Show full path
    /l = List only (shows only what would be copied)
    /log = Path to the log file
      My ComputerSystem Spec

  6.    #6

    I know there is a Robocopy answer, but, since I use a similar command to backup my data nightly using just xcopy, I thought I'd try to tweak it: the following line does it:

    xcopy "%1:\*.acl" %2:\acl_files\ /s/c/d/i/y/h

    called with 'x.bat c d' where c is obvious and d is a drive letter you want to copy to. This re-creates the folder structure on d for any acl files it finds - I had to add /h as without that it failed to copy files in the users folder (but managed \windows and \program_files). You can change 'd' to be a specific folder, of course.

    hth, Martin
      My ComputerSystem Spec

  7. Posts : 173
    Microsoft Windows 10 Home

    For comepletenees, the PowerShell version:
    $dest = 'C:\USers\Keith\Sandbox'
    gci *.ACL -force -recurse -ea silent |
        copy-item -destination {
          $destpath = join-path $dest ($_.Directory.Fullname -replace ':')
          If (!(test-path $destpath)) {new-item $destpath}
          join-path $destpath $_.Name
       } -whatif
    The code as posted (-whatif) won't actually perform the copy, just echo what operations it would perform. If the output describes the behavior you want, remove the '-whatif'

      My ComputerSystem Spec

  8. Ztruker's Avatar
    Posts : 7,808
    Windows 10 Pro X64 1809 17763.437

    @mngerhold, so what you want to do is copy one or more specific files from one or more folders on one drive to the same folder structure on another drive. Sorry, that is not what I understood your question to be.

    Glad you have several answers that will work for you.
      My ComputersSystem Spec

  9.    #9

    WOW guys. Thanks to Everyone!

    Today is Mothers day and both daughters are gone from home. One is in the Military serving overseas. I got busy trying to come up with a nifty Family Mothers Day surprise for the Wife.. I never did find the code I wanted and what you have given me is More than adequate. Better than what i had :)

    I often like to try changes in specific files and want to be able to have more than a folder list of how things were before i started.
    The original file stored in its original location is perfect backup for things like this. With the info you provided i can also see other possible uses and I appreciate all of it
      My ComputerSystem Spec

  10.    #10

    I cant get the version with the log to work? Says something wrong with the parameters? Doesn't like "/log:\log\log.txt.
    i am trying to locate the glitch but you used so many switches i am unfamiliar with.. Any idea what i am doing wrong?

    Seems i am not having a good day. KeithM, the PS version runs with no errors but the 31 ACL files are not copied to anywhere as far as i can see. I created the identical path with my username and sandbox folder in it.?
    More interesting by the minute. Even the first robocopy option fails. Or rather it runs, but when done nothing has been copied to anywhere. Even though robocopy reports that it has been, more than just opne or two files also, it reports the complete number of directories it had to create in order to run at all.
    Since the only file at the end of the path is a single .acl file that should be an impressive stack While running everything looks fine. When done, the drive it copied to is totally empty. Even the ACL folder which i created on it manually just in case I had to is now gone.
    The drive has NTFS formatting. The command is run under cmd prompt opened as admin.
    I guess this wasn't meant to be
    I can test it with other type file extensions as ACL's are technically something that probably should not be copied anyway.
    Last edited by questorfla; 6 Days Ago at 18:56. Reason: added info
      My ComputerSystem Spec

Page 1 of 2 12 LastLast

Related Threads
I need to find all the files that contain the word "word" in them. When I try to search in File Explorer, I get all the files that are Microsoft Word files. How do I search for matches on only content within the file? I need to find all the...
Hi there! I used many different file types each day, specially those related to image editors. I have many .psd and .ai files (documents for Adobe Photoshop and Illustrator). However, since I use other programs (GIMP and Inkscape), these files...
File type search? in General Support
Does anyone know of a way to search an entire computer for instances of a specific type of file? For example, Microsoft Word Document (.doc). I may know that I created a Word doc about something a long while ago e.g. a year, but I donít remember the...
So lately i found this nifty lil Twitter app that comes with Windows 10 But when i click a tweet with a vine retweet or such it gives me an error saying "Unsupported Video Type Invalid File Type" Has anyone been using the twitter app lately and are...
Hello everyone I would like to edit the file type descriptions of a number of file types on my computer. I mean the text that is written in the "File Type" column. For example, after installing Opera browser, all HTML and HTM files have the...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:01.
Find Us