Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Protected Folders Batch File Backup

19 Aug 2012   #1

W7x64
 
 
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 System SpecsSystem Spec
.

19 Aug 2012   #2

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
19 Aug 2012   #3

W7x64
 
 

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 System SpecsSystem Spec
.


19 Aug 2012   #4

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
19 Aug 2012   #5

W7x64
 
 

Thanks, thats progress. But it now says that it "skipped" the folder. Nothing is copied...
My System SpecsSystem Spec
19 Aug 2012   #6

W7x64
 
 

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 System SpecsSystem Spec
19 Aug 2012   #7

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
19 Aug 2012   #8

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
19 Aug 2012   #9

W7x64
 
 

Quote   Quote: Originally Posted by Golden View Post
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 System SpecsSystem Spec
19 Aug 2012   #10

W7x64
 
 

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 System SpecsSystem Spec
Reply

 Protected Folders Batch File Backup




Thread Tools




Our Sites

Site Links

About Us

Find 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 04:32 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33