XCOPY ACCESS DENIED

Solved
Hello,
I'm reaching out because I use a backup script for my backups.
It utilizes xcopy, but the problem is that when I run my script, even as an administrator, it says access denied.
Thank you for your help

--
Thanks in advance,
--
UnLabrdor

--
My PC:
HP Laptop 17-by0xxx

Proc. i3 7020U
RAM. 8GB DDR4 2133MHz
Disk 1TB 5400 RPM
GPU. RADEON 520 series

3 answers

  1. Hello,

    No need to run your script with admin rights, try removing the /H switch

    Your script could be simplified like this:

    call :copie Desktop Bureau call :copie Documents Documents call :copie Pictures Images call :copie Music Musique call :copie Downloads Telechargements call :copie Videos Videos exit :copie xcopy "%USERPROFILE%\%1" "D:\SAUVEGARDES\%USERNAME%\%1\" /E /R /Y /I /D echo Backup %2 [OK] goto :eof


    --

    “Artificial intelligence is defined as the opposite of natural stupidity.”
    1. Still not removing /h
      I will try your script but I would like to find out why mine doesn't work...
  2. ```html
    xcopy C:\Users\--Nom Cache--\Desktop>D:\SAUVEGARDES\--Nom Cache--\Desktop /E /H /R /Y /I /D

    echo Desktop backup [OK]

    xcopy C:\Users\--Nom Cache--\Documents>D:\SAUVEGARDES\--Nom Cache--\Documents /E /H /R /Y /I /D

    echo Documents backup [OK]

    xcopy C:\Users\--Nom Cache--\Pictures>D:\SAUVEGARDES\--Nom Cache--\Pictures /E /H /R /Y /I /D

    echo Images backup [OK]

    xcopy C:\Users\--Nom Cache--\Music>D:\SAUVEGARDES\--Nom Cache--\Music /E /H /R /Y /I /D

    echo Music backup [OK]

    xcopy C:\Users\--Nom Cache--\Downloads>D:\SAUVEGARDES\--Nom Cache--\Downloads /E /H /R /Y /I /D

    echo Downloads backup [OK]

    xcopy C:\Users\--Nom Cache--\Videos>D:\SAUVEGARDES\--Nom Cache--\Videos /E /H /R /Y /I /D

    echo Videos backup [OK]

    --
    Thank you in advance,
    --
    UnLabrdor

    --
    My PC:
    HP Laptop 17-by0xxx

    Proc. i3 7020U
    Ram. 8GB DDR4 2133MHz
    Disk 1TB 5400 RPM
    GPU. RADEON 520 series ```
    1. Even when I do an xcopy without variables from desktop to documents, it tells me access denied. I think it comes from my PC's configuration...

      --
      Thank you in advance,
      --
      UnLabrdor

      --
      My PC:
      HP Laptop 17-by0xxx

      Proc. i3 7020U
      Ram. 8GB DDR4 2133MHz
      Disk 1TB 5400 RPM
      GPU. RADEON 520 series
      1. It makes me think of a problem with misconfigured NTFS permissions, but in that case, you wouldn't have access either through Windows Explorer.

        Do you have access denied for a specific file or for a folder?
      2. @UnLabradorThe source folder or the destination folder?

        It would be good to check the NTFS permissions at least on the destination folder.
        Can you post a screenshot of the permissions for the folder D:\BACKUPS\Cache Name?