Robocopy parameter error trying to move video files from GoPro camera to PC to retain file Creation Date

bruce 0 Reputation points
2024-05-07T13:24:56.62+00:00

I am getting the following trying to use robocopy to retain the creation date when copying video files to PC:

C:\Users\Bruce>robocopy This PC\HERO10 BLACK\GoPro MTP Client Disk Volume\DCIM\100GOPRO G:\video\Go Pro /E /DCOPY:T ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows ------------------------------------------------------------------------------- Started : Monday, May 6, 2024 12:40:54 PM Source - C:\Users\Bruce\This\ Dest - C:\Users\Bruce\PC\HERO10\ Files : Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30 ------------------------------------------------------------------------------ ERROR : Invalid Parameter #3 : "BLACK\GoPro" Simple Usage :: ROBOCOPY source destination /MIR source :: Source Directory (drive:\path or \server\share\path). destination :: Destination Dir (drive:\path or \server\share\path). /MIR :: Mirror a complete directory tree. For more usage information run ROBOCOPY /?


Thanks in advance for any assistance you can provide.

Bruce

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-05-08T00:50:38.42+00:00

    Hi bruce,

    Thank you for posting on the Q&A forum.

    The issue is caused by the spaces in the path. You can enclose the path in double quotation marks to make the paths and parameters recognized correctly.

    robocopy "This PC\HERO10 BLACK\GoPro MTP Client Disk Volume\DCIM\100GOPRO" "G:\video\Go Pro" /E /DCOPY:T
    
    

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.


  2. MotoX80 36,291 Reputation points
    2024-05-13T13:36:01.24+00:00

    to retain the creation date

    Does the GoPro set the file properties?

    User's image

    If so, copy the files using the Windows Explorer as you normally would, then use Powershell to read the properties and set the timestamps based on that value.

    Open Powershell_ISE and paste this script into it. Set the folder variable to point to the folder where your files are at. If you have multiple folders, we will need to modify the code.

    This script sets both the Created date and the LastWritten date. If you don't want both set, then just remove that line.

    If the GoPro uses a different property name, or date format, then we will need to modify the script to account for that.

    $folder = 'c:\YourFolderName'
    cls
    $shell = New-Object -COMObject Shell.Application
    $files = Get-ChildItem -Path $folder 
    $shellfolder = $shell.Namespace($folder)
    foreach ($f in $files) {
        ""
        $f.name 
        $PicDate = "" 
        $shellfile = $shellfolder.ParseName($f.name )
        # To find the ID of the extended attribute you're interested in:
        0..287 | ForEach-Object {
            $prop = $shellfolder.GetDetailsOf($null, $_)
            $date = $shellfolder.GetDetailsOf($shellfile, $_)
            if ($shellfolder.GetDetailsOf($null, $_) -eq "Date taken") {        
                if ($date -ne "") { 
                    $PicDate = $date
                    '{0} = {1} = {2}' -f $_, $prop, $date
                }
            }
            if ($shellfolder.GetDetailsOf($null, $_) -eq "Media created") {   
                if ($date -ne "") { 
                    $PicDate =  $date
                    '{0} = {1} = {2}' -f $_, $prop, $date
                }             
            }
        }
        if ($PicDate -ne "") {
            $PicDate = ($PicDate.ToCharArray() | foreach {if ($_ -match '([\d:/apm ])') {$Matches[0]}}) -join ""       # remove any hex values 
            "Current time is {0}" -f $f.LastWriteTime
            "Set it to $PicDate"
            
            # Select which time value you want to update 
            $f.LastWriteTime = [datetime]$PicDate         
            $f.CreationTime = [datetime]$PicDate
        }
    }
    
    
    

    It should look like this.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.