Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying folders & permissions

Status
Not open for further replies.

ghoe

Technical User
Mar 26, 2002
3
NL
Hi I've got a little problem :),
I have made a structure of a folder with sub folders and sub sub folders etc.
All of the folders have their own specific security permissions.
Now wat I want to do is copy the topmost folder and all of its contents without losing all the security permissions. If I simply copy the folder all the subfolders inherit the permissions of the topmost folder,
does anyone know how to do this?

thanx,

ghoe
 
If you copy on the same drive it will inherit. Move the folder and it will retain. Try copying the directory to another drive (it will retain) then copy or move back to the origional drive.
 
thnx a lot i'll try that
 
If you copy a folder with NTFS permissions and the destination is on the same drive, the permissions will go with it. If you copy a folder to a different drive, permissions will be reset.
If you need to get the folders onto another drive and retain permissions, one solution would be to set up the two drives as a mirror set, let it build the array, and then break the mirror. Then you've got your permissions intact on the other hard drive.
 
From my understandidg, anytime you copy you lose the permissions. The only time you don't is when you move (not copy) within the same partition. The mirror would work and may be the best method. Someone on one of the forums mentioned a third party utility that would accomplish what you want to do. Might try a search.


Good luck
 

I may be a little late in the day but I've got just the same problem and just resolved it. Use xcopy /E /O /I

As an example I am wanting to copy

d:\data\sales\france\peugeot and it four subfolders North South East and West, all of which have specific permissions differing from one another. What I do therefore to copy peugeot and its for sub folders to a new folder called Renault in the same directory copying the four sub folders North South East and West is:

xcopy d:\data\sales\france\peugeot d:\data\sales\france\renault /E /O /I

Hope this helps someone, certainly helps me and made me jump for joy
 
I may be a little late in the day but I've got just the same problem and just resolved it. Use xcopy /E /O /I

As an example I am wanting to copy

d:\data\sales\france\peugeot and it four subfolders North South East and West, all of which have specific permissions differing from one another. What I do therefore to copy peugeot and its for sub folders to a new folder called Renault in the same directory copying the four sub folders North South East and West is:

* represents a space incase it isn't clear

xcopy*d:\data\sales\france\peugeot*d:\data\sales\france\renault*/E /O /I

Hope this helps someone, certainly helps me and made me jump for joy
 
Moving folders/files is not the problem but to maintain the shares you need to do the following:

To copy the files you will need to use the SCOPY utility that is supplied with the resource kit to keep the current permission/audit settings

SCOPY <current>:\<dir> <new>:\<dir> /o /a /s

On the machine that currently hosts the shares, use regedit/regedt32.

Move to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
Click on Shares, and select Save Key from the Registry Menu
Enter the name of a file, e.g. shares.reg and click OK
Copy this file to the target machine
Again start the registry editor (regedt32.exe) and move to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares and select Shares.
From the Registry menu, select Restore and select the file you saved, e.g. shares.reg then save and exit.
Reboot the machine and once restarted you will see the new shares

--------------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top