# Copy files and keep permissions?

**URL:** <https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839>\
**Category:** Factual Questions\
**Created:** [September 20, 2002, 5:26pm UTC](https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839 "2002-09-20T17:26:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bricker](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Bricker](https://boards.straightdope.com/u/Bricker)\
**Post date:** [September 20, 2002, 5:26pm UTC](https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839/1 "2002-09-20T17:26:45Z")

</div>

If I copy a directory (which has subdirectories and files) from one server to another in a Win2K domain, how do I make sure that the new copy has the same file and access permissions as the original did?

- Rick

---

<div class="post-metadata">

**Author:** ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)\
**Post date:** [September 20, 2002, 7:43pm UTC](https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839/2 "2002-09-20T19:43:55Z")

</div>

Using **xcopy** with the **/O** switch should do it.  
Type **xcopy /? |more** at the command line to see all its switches and parameters.

---

<div class="post-metadata">

**Author:** ![breaknrun](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@breaknrun](https://boards.straightdope.com/u/breaknrun)\
**Post date:** [September 20, 2002, 7:46pm UTC](https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839/3 "2002-09-20T19:46:18Z")

</div>

I don’t know of a native way to do that. I can ask around. You may have to use commercial software such as [secure copy](http://web01.ebf.net/software/securecopy/securecopy.htm).  
This at least is what one tech from Network Appliance told us when we were migrating data from our NT servers to a NetApp filer.

---

<div class="post-metadata">

**Author:** ![Riboflavin](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Riboflavin](https://boards.straightdope.com/u/Riboflavin)\
**Post date:** [September 20, 2002, 7:51pm UTC](https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839/4 "2002-09-20T19:51:37Z")

</div>

Like number said, ‘xcopy /o’ should do the trick, though it’s always best to play around with it on some dummy data to make sure it does what you think it does before you rely on it.

Also, for anyone still using NT3.51 or NT4, you should get the appropriate Windows NT resource kit from MS (it’s $50 or so for the disk and book) - one of the utilities on it is ‘scopy’, which also copies permissions (pre-win2k xcopy doesn’t have the /o switch).

---

<div class="post-metadata">

**Author:** ![breaknrun](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@breaknrun](https://boards.straightdope.com/u/breaknrun)\
**Post date:** [September 20, 2002, 7:55pm UTC](https://boards.straightdope.com/t/copy-files-and-keep-permissions/128839/5 "2002-09-20T19:55:07Z")

</div>

OK some quick googling turns up XXCOPY (as opposed to single-x copy) and Robocopy as utilties that can preserve file permissions and nt security information.  
check out:  
[http://www.xxcopy.com/xxcopy30.htm](http://www.xxcopy.com/xxcopy30.htm)

> **[Developer tools, technical documentation and coding examples](https://docs.microsoft.com/en-us/?url=%2Ftechnet%2Fcolumns%2Ftips%2FDefault.asp)**
>
> The home for Microsoft documentation and learning for developers and technology professionals.

On that second link, you’ll have to scroll down to the 2nd question, the one about scopy.
