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

Discus and support recursively search C: for specific file-type type then copy w/Path in Windows 10 Support to solve the problem; 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... Discussion in 'Windows 10 Support' started by questorfla, May 11, 2019.

  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.

    :)
     
    questorfla, May 11, 2019
    #1

  2. [Solved] PowerShell search string and copy file

    Hi all,

    I'm preparing a script to find some text inside the files ('test' and 'test1' are the keywords in this scenario) and once all the files have been found, they should be copied to a different location while maintaining the folder structure.

    For example: The path c: \src\ contains 10 files, 3 include the search words. These 3 files should be copied to c:\dst\

    Everything should be recursive for all subdirectories of c:\src\.

    So if in the path c:\src\somefolder

    \ there were other files with the same search words, they should be copied to c:\dst\somefolder \

    Here my code:

    ### Code ###

    Write-Host ""

    Write-Host "Note: Path must end with '\'"

    Write-Host ""

    # Var.

    $sourceDir = Read-Host 'Source path'

    $targetDir = Read-Host 'Destination path'

    # Decl.

    $tree = gci -Directory -Name -Recurse $sourceDir

    # Check if $sourceDir exist

    if(!(Test-Path -Path $sourceDir )){

    "Source is not a valid path!" ; pause

    exit 1

    }

    # Check (and create) $targetDir

    if(!(Test-Path -Path $targetDir )){

    mkdir $targetDir -Force

    }

    # Rebuild Tree

    foreach ( $folders in $tree ) { mkdir $targetDir\$folders -Force }

    # Copy Founded Files

    $ftc = Get-ChildItem $sourceDir -Recurse | Select-String "test","test2" | Select Path |

    foreach{

    $targetFile = $targetDir + $_.FullName.SubString($sourceDir.Length);

    Copy-Item $_ -destination $targetFile

    }

    ### EOF ###

    I can not figure out where the error is. Does anyone know how I can solve it ?

    The proposed error is: Copy-Item: Unable to find the unit. A unit named '@ {Path = C' does not exist.
     
    DennisAnfossi, May 11, 2019
    #2
  3. JSamuel3 Win User
    How To Type a File Path Without Username

    I'm trying to type a file path to the documents folder that can be used on any PC.

    However, when I use C:\Users\username\Documents it only works on my PC, because it's specific to my username.

    Is there a way to type a file path to the documents folder that will work on any PC?
     
    JSamuel3, May 11, 2019
    #3
  4. sfcsfcsfc Win User

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

    File search types in the Windows 10 file explorer search (using words)

    Hi

    I am trying to find out how I can search for specific files from the File Explorer.

    So far, I have found out that you can search for files with specific names if you type "name:<name>" into the search input field.

    Were can I find a list of the verbose search commands i.e. a list of the words+column character I should use to search files by other properties than their name?

    For example, what should I type if I am trying to list files by file type:

    filetype:<whatever>

    or

    type:<whatever>

    or what?

    I know that there is a Search toolbar, but I would like to just type the search into the search field to speed up the process. Also, I do not wish to use Cortana et al. I'd just like to use plain simple verbose search....

    Thanks
     
    sfcsfcsfc, May 11, 2019
    #4
Thema:

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

Loading...
  1. recursively search C: for specific file-type type then copy w/Path - Similar Threads - recursively search specific

  2. Copying / moving only one specific type of file

    in Windows 10 Ask Insider
    Copying / moving only one specific type of file: Hi! First of all, thank you for even taking the time to read this. TL:DR - How do I, in a large folder with ~200 more folders, select one type of file? To move on to my 'issue' right away; I have one large folder that consists of ~200 more folders. Each of those folders has...
  3. type to search not working can not type in type to search

    in Cortana
    type to search not working can not type in type to search: It randomly happened that i couldn't type in type to search bar and i tried doing sfc /scannow and it said some fiels are corruptedand said it repaired them but it didn't....
  4. Is there a way to make Windows 10 to search for a specific file type?

    in Windows 10 Ask Insider
    Is there a way to make Windows 10 to search for a specific file type?: I have a PC with 4 diffrent hard drives installed... Actually 3 hard drives and 1 SSD... Not too long ago I made a .rar file that I can't remember where I put it or what was it called... Is there a way to make windows 10 search for all .rar files somehow so that I can find it...
  5. recursively copy files

    in Windows 10 Network and Sharing
    recursively copy files: I was wondering if there was a way to recursively copy files with windows for example I have an Adobe CD or DVD and there is a folder of fonts. Manually copying them is very tedious. so I was wondering if there was a way to do this with a batch file or shell script...
  6. Search syntax for "folders containing specific file types" ??

    in Windows 10 Support
    Search syntax for "folders containing specific file types" ??: Does anyone know if there is a syntax for finding all folders containing certain types of files? Like if I wanted to find every folder on my D drive containing photos (and have just the folders listed in the search results.) Or find every folder containing ebooks, whatever....
  7. Recursively Delete File Types From A Named Folder Only

    in Windows 10 Network and Sharing
    Recursively Delete File Types From A Named Folder Only: I have a weekly cleanup routine I want to setup where I scan an entire directory of users folders and delete file types *.psr and *.zip but only in certain folders. Not every sub-folder. Each user's folder in this directory has a sub-folder named the exact same name for all...
  8. Batch file to search directory for file type and copy to new location

    in Windows 10 Support
    Batch file to search directory for file type and copy to new location: Hi all, Not sure if posting in correct area, I would like to have a batch file that can search a directory or drive for file type and copy that file into a new directory renaming the file to reflect what users folder it came out of. To be a little more specific, I have...
  9. copied file has no file type

    in Windows 10 Support
    copied file has no file type: Hello can someone tell me how to add the file type to a file? I copied 2 video files from my samsung galaxy onto my dell PC but when I open properties beside file type it just says file instead of mp4 which I know they are because I made the videos. Im assuming the solution...
  10. File type search?

    in Windows 10 Support
    File type search?: 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 name of it, and where I...