Windows 10: ROBOCOPY fails copying files from source root

Discus and support ROBOCOPY fails copying files from source root in Windows 10 Software and Apps to solve the problem; When copying files from source root, it seems that ROBOCOPY see the files as directories and the resoult is, that the filename become a directoiry name... Discussion in 'Windows 10 Software and Apps' started by Malte Christensen, Mar 8, 2023.

  1. ROBOCOPY fails copying files from source root


    When copying files from source root, it seems that ROBOCOPY see the files as directories and the resoult is, that the filename become a directoiry name on targetHow can I prevent thatMy code:$FileName = Get-Date.tostring"MM-dd-yyyy---HH-mm-ss"$oldpaths = Get-ChildItem "\\rghsofsctxapp01\mdt$\*"$newpath = 'Q:\CTXMDT\'Set-Location $newpathforeach$oldpath in $oldpaths{ $newpath1 = $newpath + $oldpath.Name mkdir $newpath1 -ErrorAction Ig

    :)
     
    Malte Christensen, Mar 8, 2023
    #1
  2. sba123 Win User

    robocopy files but exclude files in root

    Hello,

    I want to copy this directory, but exclude the files in root (a,b,c):

    [table][tr][td]Source:c:\src\test\ - a.txt - b.txt - c.txt - sub1\ - d.txt - sub2\ - e.txt[/td][td]Destination:c:\dest\test\ - sub1\ - d.txt - sub2\ - e.txt[/td][/tr][/table]
    I tried:

    - robocopy c:\src\test c:\dest\test /s /xd c:\src\test => a,b,c are copied ROBOCOPY  fails copying files from source root :(

    - robocopy c:\src\test c:\dest\test /s /xd test => a,b,c are copied ROBOCOPY  fails copying files from source root :(

    - robocopy c:\src\test c:\dest\test /s /xd . => a,b,c are copied ROBOCOPY  fails copying files from source root :(

    - robocopy c:\src\test c:\dest\test /s /xd .. => a,b,c are copied ROBOCOPY  fails copying files from source root :(

    - robocopy c:\src\test c:\dest\test /s /xf c:\src\test\*.txt => Invalid parameter #5 ROBOCOPY  fails copying files from source root :(

    I want to avoid a call for every \subX\ (robocopy c:\src\test\sub1 c:\dest\test\sub1 /s ...)

    And I don't want to put robocopy inside a for loop to copy the subs or delete the files in a second step.

    Is this possible anyhow?
     
    sba123, Mar 8, 2023
    #2
  3. JKriv2 Win User
    Robocopy - Is there any way to verify the copied file matches the source?

    It doesn't appear there is anyway for Robocopy to verify/confirm the copied file matches the source, is that the case?
     
    JKriv2, Mar 8, 2023
    #3
  4. sba123 Win User

    ROBOCOPY fails copying files from source root

    robocopy files but exclude files in root

    Hi Lynn,

    thanks for your reply.

    >> Regarding the <file name>, it is advised to use a.txt b.txt c.txt instead.

    "a.txt b.txt c.txt" was only an example. Might be that there are hundreds of txt files, which of course, I dont't want to add with /xf to robocopy.

    Another case would be to use robocopy in a script not knowing which files are present in the root folder. Using a loop to only copy the sub folders or deleting the root files after copying the whole folder is what I want to avoid.

    I will have a look on the IT Pro link you posted in your answer. Maybe I can find a useful hint there ROBOCOPY  fails copying files from source root :)

    Regards
     
    sba123, Mar 8, 2023
    #4
Thema:

ROBOCOPY fails copying files from source root

Loading...
  1. ROBOCOPY fails copying files from source root - Similar Threads - ROBOCOPY fails copying

  2. HELP on ROBOCOPY to copy the entire source path from the root under target

    in Windows 10 Gaming
    HELP on ROBOCOPY to copy the entire source path from the root under target: SOURCE FOLDER: C:\onedrive\Images\design with dozens of subfolders and files underI want to copy the JPG from the source but don't know exactly where they are. There could be jpg files among several subfolders under the sourceTARGET D:\DestinoThe entire source folder...
  3. HELP on ROBOCOPY to copy the entire source path from the root under target

    in Windows 10 Software and Apps
    HELP on ROBOCOPY to copy the entire source path from the root under target: SOURCE FOLDER: C:\onedrive\Images\design with dozens of subfolders and files underI want to copy the JPG from the source but don't know exactly where they are. There could be jpg files among several subfolders under the sourceTARGET D:\DestinoThe entire source folder...
  4. ROBOCOPY fails copying files from source root

    in Windows 10 Network and Sharing
    ROBOCOPY fails copying files from source root: When copying files from source root, it seems that ROBOCOPY see the files as directories and the resoult is, that the filename become a directoiry name on targetHow can I prevent thatMy code:$FileName = Get-Date.tostring"MM-dd-yyyy---HH-mm-ss"$oldpaths = Get-ChildItem...
  5. ROBOCOPY fails copying files from source root

    in Windows 10 Gaming
    ROBOCOPY fails copying files from source root: When copying files from source root, it seems that ROBOCOPY see the files as directories and the resoult is, that the filename become a directoiry name on targetHow can I prevent thatMy code:$FileName = Get-Date.tostring"MM-dd-yyyy---HH-mm-ss"$oldpaths = Get-ChildItem...
  6. Robocopy - Is there any way to verify the copied file matches the source?

    in Windows 10 Gaming
    Robocopy - Is there any way to verify the copied file matches the source?: It doesn't appear there is anyway for Robocopy to verify/confirm the copied file matches the source, is that the case? https://answers.microsoft.com/en-us/windows/forum/all/robocopy-is-there-any-way-to-verify-the-copied/f577d35f-fa2c-4c8d-ab97-93852d8e1bcb
  7. Robocopy - Is there any way to verify the copied file matches the source?

    in Windows 10 Network and Sharing
    Robocopy - Is there any way to verify the copied file matches the source?: It doesn't appear there is anyway for Robocopy to verify/confirm the copied file matches the source, is that the case? https://answers.microsoft.com/en-us/windows/forum/all/robocopy-is-there-any-way-to-verify-the-copied/f577d35f-fa2c-4c8d-ab97-93852d8e1bcb
  8. robocopy files but exclude files in root

    in Windows 10 Network and Sharing
    robocopy files but exclude files in root: Hello,I want to copy this directory, but exclude the files in root a,b,c:Source:c:\src\test\ - a.txt - b.txt - c.txt - sub1\ - d.txt - sub2\ - e.txtDestination:c:\dest\test\ - sub1\ - d.txt - sub2\ - e.txtI tried:- robocopy c:\src\test...
  9. robocopy files but exclude files in root

    in Windows 10 Gaming
    robocopy files but exclude files in root: Hello,I want to copy this directory, but exclude the files in root a,b,c:Source:c:\src\test\ - a.txt - b.txt - c.txt - sub1\ - d.txt - sub2\ - e.txtDestination:c:\dest\test\ - sub1\ - d.txt - sub2\ - e.txtI tried:- robocopy c:\src\test...
  10. robocopy files but exclude files in root

    in Windows 10 Software and Apps
    robocopy files but exclude files in root: Hello,I want to copy this directory, but exclude the files in root a,b,c:Source:c:\src\test\ - a.txt - b.txt - c.txt - sub1\ - d.txt - sub2\ - e.txtDestination:c:\dest\test\ - sub1\ - d.txt - sub2\ - e.txtI tried:- robocopy c:\src\test...