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
goomba619

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
Alejandro85

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
goomba619

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
Alejandro85

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
goomba619

W7x64
 
 

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

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
Alejandro85

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
Golden
Microsoft MVP

Windows 7 Ult. 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
goomba619

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
goomba619

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





Similar help and support threads
Thread Forum
[Help] Batch File move every 15.000 files to another folders
Hi guys I'm new here, please help I have about 2 million email files that i want to convert into mbox files. but the tool i used only can convert every 15.000 files. so i need a batch file that can move this 2 million files into another folder (15.000 files each folder) and the folder name...
General Discussion
Giving Automatic Permissions to Folders Created Using a Batch File
So I have a batch file set up to create folders and subfolders. These folders are created on a shared server that several employees access. The idea is to run the batch to create a set of folders for each new customer. This keeps all of the files for the customer in one spot rather than...
General Discussion
Is there a Script or batch file that can create folders by date range
I was wondering if there was a way to create a set of folders in a specific directory according to a date range that i input. ie. Select start date 2011 10 01 select end date 2012 10 01 Select Output path of c:\users\XXXX\desktop\export data
General Discussion
a simple batch file for copy files and folders
I want to write a batch file that do this for me: - makes a directory with the "yy.mm.dd.hh.mm" as the directory name, - copies files and folders from a TEST directory to above destination, - copies only new (or modified) files from the TEST directory to a separate folder. Any Idea?
General Discussion
Batch file to de-fragment, backup, then shutdown?
Hey guys, Is there a way I can create a batch file so de-fragment my hard drive, once that has finished, backup to an external hard drive, and then one that has finished shut down the PC? Thanks, JPiiONEFOURONE
General Discussion
Sharing folders with homegroup, using a batch file?
Hello, Due to some drives being portable, windows unshares them all the time on reboot, so I'm wondering if there is a command line option (batch command) to share folders with a homegroup. I already did some checking, and found that when you share a folder, it starts the process...
Network & Sharing

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 11:59.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App