Windows 10: HELP on ROBOCOPY to copy the entire source path from the root under target

Discus and support HELP on ROBOCOPY to copy the entire source path from the root under target in Windows 10 Software and Apps to solve the problem; 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... Discussion in 'Windows 10 Software and Apps' started by CauZion, Jul 18, 2024.

  1. CauZion Win User

    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 structure is something like: C:\onedrive\Images\Design C:\onedrive\Images\Design\Folder1 C:\onedrive\Images\Design\Folder2 C:\onedrive\Images\Design\Folder2\Sub2 C:\onedrive\Images\Design\Folder3 C:\onedrive\Images\Design\Folder3\Sub3\Subsub3 C:\onedrive\Images\Design\folder4If t

    :)
     
    CauZion, Jul 18, 2024
    #1

  2. ROBOCOPY fails copying files from source root

    When copying files from source root, it seems that ROBOCOPY see the file(s) as directories and the resoult is, that the filename become a directoiry name on target

    Logfile says:

    2023/03/08 11:16:09 ERROR 267 (0x0000010B) Accessing Source Directory \\XXXXXXXXXX\mdt$\Placer IKKE l›se filer i hovedshare - Vedr_backup_VIGTIGT.txt\

    The directory name is invalid.

    How can I prevent that

    My code:

    $FileName = (Get-Date).tostring("MM-dd-yyyy---HH-mm-ss")

    $oldpaths = Get-ChildItem "\\XXXXXXXXXX\mdt$\*"

    $newpath = 'Q:\CTXMDT\'

    Set-Location $newpath

    foreach($oldpath in $oldpaths)

    {



    $newpath1 = $newpath + $oldpath.Name

    mkdir $newpath1 -ErrorAction Ignore > $null



    robocopy $oldpath $newpath1 /Z /MT:16 /MIR /W:0 /R:0 /V /TS /FP /PF /E /FFT /XO /SEC /XD ".snapshots" /XD "$RECYCLE.BIN" | Out-File D:\Logfiler\XXXXXXXXXX_MDT\"$FileName MDT.log" -Append



    Write-Host "$oldpath has been copiet to $newpath1"

    }

    Best regards

    MACH
     
    Malte Christensen, Jul 18, 2024
    #2
  3. ROBOCOPY fails copying files from source root

    Hi Elise

    Thanks for replying om my problem.....

    Well same resoulth with robocopy "$oldpath"

    I just tested my robocopy command in a commandline, and that works fine

    ( robocopy \\XXXXXXXX\mdt$\ Q:\CTXMDT\ /Z /MT:16 /MIR /W:0 /R:0 /V /TS /FP /PF /E /FFT /XO /SEC /XD ".snapshots" /XD "$RECYCLE.BIN" )

    So for some reason, - Powershell is the challange and not Robocopy as I expected...

    The funny thing is, - that if the file allready excist on target, - my powershell script does not create a folder as I would expect....

    Best regards...

    Malte C",)
     
    Malte Christensen, Jul 18, 2024
    #3
  4. TomLee99 Win User

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

    Robocopy WIndows 10 strange behavior. It will add the root to the path

    Hi Every,

    I tried to run robocopy on cmd with run as administrator.

    robocopy '\\server\M Drive\SQL Data\" "E:\SQL Data\"

    I got an error. The path c:\windows\system32\\\server\M Drive\SQL Data\" does not find on source and c:\windows\system32\E:\SQL Data\ does not find on destination.

    Please help.

    Thanks

    Tom
     
    TomLee99, Jul 18, 2024
    #4
Thema:

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

Loading...
  1. HELP on ROBOCOPY to copy the entire source path from the root under target - Similar Threads - HELP ROBOCOPY copy

  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. 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...
  4. 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...
  5. ROBOCOPY fails copying files from source root

    in Windows 10 Software and Apps
    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 Software and Apps
    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 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
  8. 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
  9. Robocopy: copy drive root directory creates hidden backup folder

    in Windows 10 Software and Apps
    Robocopy: copy drive root directory creates hidden backup folder: Windows 10 Home 21H2 19044.1526, 64-bit Robocopy 10.0.19041.1266 Run Robocopy via .bat file, Run as Administrator. Hello: When I use Robocopy to copy the root directory of a drive D: to a folder non-root directory on an external drive, the resulting destination folder is...
  10. Robocopy WIndows 10 strange behavior. It will add the root to the path

    in Windows 10 Installation and Upgrade
    Robocopy WIndows 10 strange behavior. It will add the root to the path: Hi Every, I tried to run robocopy on cmd with run as administrator. robocopy '\\server\M Drive\SQL Data\" "E:\SQL Data\" I got an error. The path c:\windows\system32\\\server\M Drive\SQL Data\" does not find on source and c:\windows\system32\E:\SQL Data\ does not find...