Protected Folders Batch File Backup

Page 1 of 2 12 LastLast

  1. Posts : 18
    W7x64
       #1

    Protected Folders Batch File Backup


    So I am trying to create a batch file that will copy certain folders from the My Documents and Program Files 86 folders. Of course these are protected. I can make a batch file and use robocopy to copy other files just fine. How can I set admin privileges? Or whatever it is I need to do to make it work? I am using group policy editor to run the bat file on shutdown.

    Example:

    Robocopy C:\Folder\ D:\Folder\

    that works fine...but when I try copying files out of Program Files x86 or My Documents the batch fails
      My Computer


  2. Posts : 2,468
    Windows 7 Ultimate x64
       #2

    But why fails? What error message is thrown?
    First of all, try to run the bat manually by double clicking, and see if it works there. Then you can try to automate, but it's easier to go one step at a time.

    About permissions, Program Files has read access for every user, and My Documents has read-write for you and nothing for others. So running manually you should be able to do it, provided you have write permissions on the target folder.

    Maybe it's a problem caused by running at shutdown. Check under what user context is running the bat in that condition.
      My Computer


  3. Posts : 18
    W7x64
    Thread Starter
       #3

    I have been trying it by running manually. If I add a "pause" to the end of the command It shows error: Invalid Parameter #3 J:\Test\test




    This is the command I have been using which works on any other folders besides protected ones....


    robocopy C:\Program Files(x86)\HTC J:\Test\test
    Pause
      My Computer


  4. Posts : 2,468
    Windows 7 Ultimate x64
       #4

    I see a problem!
    When you refer in command line to paths with spaces, you must enclose it in double quotes, otherwise it interprets it wrong.

    The command should be:
    robocopy "C:\Program Files(x86)\HTC" J:\Test\test
      My Computer


  5. Posts : 18
    W7x64
    Thread Starter
       #5

    Thanks, thats progress. But it now says that it "skipped" the folder. Nothing is copied...
      My Computer


  6. Posts : 18
    W7x64
    Thread Starter
       #6

    Some internet digging brought up this

    "Protected files happen when you copy content through a share or download it through Internet explorer.
    The OS adds a zone identifier to the file. Users can still access the file, but copying them through command line tools is no longer possible. I have no idea what the use of this great feature is. But I'm looking for a sollution to it"


    Sounds like this is happening to me. It seems that I cannot simply make a batch file to copy anything out of protected folders
      My Computer


  7. Posts : 2,468
    Windows 7 Ultimate x64
       #7

    Makes no sense at all skipping all those files for the simple fact that they were downloaded with IE. Seems like a bug with robocopy to me. Can you try the normal copy or xcopy instead?
      My Computer


  8. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
       #8

    Hi,

    Try using the /COPYALL flag, like this:

    Code:
    robocopy "C:\Program Files(x86)\HTC" J:\Test\test /COPYALL
    More reading:
    ROBOCOPY - Create Backup Script

    Regards,
    Golden
      My Computer


  9. Posts : 18
    W7x64
    Thread Starter
       #9

    Golden said:
    Hi,

    Try using the /COPYALL flag, like this:

    Code:
    robocopy "C:\Program Files(x86)\HTC" J:\Test\test /COPYALL
    More reading:
    ROBOCOPY - Create Backup Script

    Regards,
    Golden
    I tried that, using robocopy, xcopy, and copy. Robocopy says

    "You do not have the Manage Auditing user right. You need this to copy auditing information </COPY:U or /COPYALL>."
      My Computer


  10. Posts : 18
    W7x64
    Thread Starter
       #10

    Copy says file not found, Xcopy says 0 files copied. Seems like I need to somehow "log" in to get the access to those files
      My Computer


 
Page 1 of 2 12 LastLast

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

© Designer Media Ltd
All times are GMT -5. The time now is 22:17.
Find Us