XCOPY ACCESS DENIED

Solved
UnLabrador Posted messages 75 Registration date   Status Member Last intervention   -  
UnLabrador Posted messages 75 Registration date   Status Member Last intervention   -
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. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
     
    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
    1. UnLabrador Posted messages 75 Registration date   Status Member Last intervention   2
       
      Still not removing /h
      I will try your script but I would like to find out why mine doesn't work...
      0
  2. UnLabrador Posted messages 75 Registration date   Status Member Last intervention   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 ```
    0
  3. UnLabrador Posted messages 75 Registration date   Status Member Last intervention   2
     
    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
    0
    1. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930
       
      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?
      0
    2. UnLabrador Posted messages 75 Registration date   Status Member Last intervention   2 > barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention  
       
      It says access denied to the entire folder...
      0
    3. barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention   4 930 > UnLabrador Posted messages 75 Registration date   Status Member Last intervention  
       
      The 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?
      0
    4. UnLabrador Posted messages 75 Registration date   Status Member Last intervention   2 > barnabe0057 Posted messages 14329 Registration date   Status Contributor Last intervention  
       
      0
    5. UnLabrador Posted messages 75 Registration date   Status Member Last intervention   2 > UnLabrador Posted messages 75 Registration date   Status Member Last intervention  
       
      0