Windows 10 backup using a batch file


  1. Posts : 1
    Windows 7
       #1

    Windows 10 backup using a batch file


    Hello I hope someone can help.
    We use a script which runs a batch file to backup laptops at the company I work at. To get it to work in Windows 7 we just add the user to the backup operators group.
    We have just started a few people with Windows 10. Set them up in the same way.
    C:\Data"contains batch file"
    Desktop "contains script"
    User added to the backup operators group.

    However the backup doesn't run we get an access error which in Windows 7 always meant the user wasn't in the backup operators group. This is either running the script or the batch file directly.

    Edit: this fails if the user is a standard user or an Administrator.

    The batch file will run fine if we right click and "run as administrator".

    UAC is switched off.

    Is there any other changes permissions wise we need to make?

    Thanks in advance
      My Computer


  2. Posts : 3,865
    Windows 3.1 to Windows 10
       #2

    Since you have UAC turn off add this to the top of your batch file

    Code:
    set "params=%*"
    setlocal EnableDelayedExpansion
    cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || (  echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
    
    %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || (
    echo ============================================================
    echo ERROR: Run The Script As Administrator.
    echo ============================================================
    echo.
    echo.
    echo Press any key to exit...
    pause >nul
    goto :eof
    )
    the ERROR message is there just in case, although batch will start / run as admin
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:42.
Find Us




Windows 10 Forums