none
How do i Activate Robocopy with /B (or /ZB) Flags?

    Question

  • Robocopy is failing when it is activated by clicking on my "run_bckup.bat" file.
    Although the batch file has Admin-privileges, the following line fails:

      Robocopy "%src%" "%trgt%" .. /B ..  

    But starting the DOS-Window (open as Administrator) & running the same file "run_bckup.bat"
    succeeds!!  

    My Question:
    Is there a setting that allows me to activate robocopy by clicking on my batch-file, while using the flag "/B" ?

    Here are the Robo reports for the 2 cases above.

    ==== 1. ROBOCOPY REPORT ON "RUNNING BY CLICKING" on "run_bckup.bat" ====
    (this method failed)

    ERROR : You do not have the Backup and Restore Files user rights.
    *****  You need these to perform Backup copies (/B or /ZB).

    Source : c:\Utils - bckup\
    Dest   : G:\Utils - bckup\
    Files  : *.*
    Options : *.* /NFL /S /E /DCOPY:DAT /COPY:DATS /PURGE /B /XO /XA:SHT /R:5 /W:1 

    --- END OF REPORT 1 --

    ==== 2. ROBOCOPY REPORT ON RUNNING by OPEN DOS-Window, and then run "run_bckup.bat" ====
    (this method succeeded)

    Source : c:\Utils - bckup\
    Dest   : G:\Utils - bckup\
    Files  : *.*
    Exc Files : *NTUSER*
    Exc Dirs : *AppData*
        *Templates*
        *Administrator*

      Options : *.* /NFL /S /E /DCOPY:DAT /COPY:DATS /PURGE /B /XO /XA:SHT /R:5 /W:1

               Total    Copied   Skipped  Mismatch    FAILED    Extras
        Dirs :         1         1         0         0         0         0
       Files :        19        19         0         0         0         0
       Bytes :    31.4 k    31.4 k         0         0         0         0
    --- END OF REPORT 2-------------

    Thanks, Uxy

        
    Tuesday, January 02, 2018 8:27 AM

All replies

  • Are you right-clicking and selecting RUN AS ADMIN?  RUN AS A DIFFERENT USER? (You may need to hold SHIFT down then right-click to see the option).

    Tuesday, January 02, 2018 12:20 PM
  • There are x3 ways - that i know -  that let me "run as Admin" (Windows 8.1)

    1. By clicking Win-key & select run as Admin. --> It opens DOS command window Then I launch "my_prog.bat"

    2. By clicking on "my_prog.bat"

    3. The way you suggested (Right click on "my_prog.bat" & select to: "run as Admin") 

    ONLY THE 1ST OPTION WORKS!! (that is to say, robocopy runs with the flag /B)

    The 1st option (the one that works) is  THE MOST UNDESIRED ONE!!

    Google search shows references on this topic for 10 Years or so with NO CLEAR ANSWER (that is say, how to run application - as Admin with full privileges - just by clicking on it)

     Many thanks for your attention; Uxy


    Wednesday, January 03, 2018 2:36 AM
  • Hi,

    Please try to use Process Monitor to capture the two process and see if there is any difference.

    Here are steps for you use this tool.

    1. Click Capture when you capture the process, after the process, please also click Capture.

    2. Use Filter to filter the item of running the .bat file.

    Here is a link for you to download Process Monitor.

    Process Monitor v3.40

    https://docs.microsoft.com/en-us/sysinternals/downloads/procmon


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, January 03, 2018 10:19 AM