# Net use, XCOPY and the /K switch

**URL:** <https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702>\
**Category:** Factual Questions\
**Created:** [January 14, 2005, 1:15pm UTC](https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702 "2005-01-14T13:15:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllShookDown](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AllShookDown](https://boards.straightdope.com/u/AllShookDown)\
**Post date:** [January 14, 2005, 1:15pm UTC](https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702/1 "2005-01-14T13:15:21Z")

</div>

Every month I have to copy a ton of Excel files out to our branch LANs. When we were using Novell servers and “map root” I used XCOPY with the /K switch to keep the read-only attributes on the files. It worked fine.

Now I’m using “net use” to map the drives and XCOPY with the /K switch and it’s not working. Does anyone know how I can make the read-only attributes stick? I’ve Googled myself silly and can’t find anything.

---

<div class="post-metadata">

**Author:** ![Anonymous\_Coward](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@Anonymous\_Coward](https://boards.straightdope.com/u/Anonymous_Coward)\
**Post date:** [January 14, 2005, 1:33pm UTC](https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702/2 "2005-01-14T13:33:58Z")

</div>

/k should work. 😕

Note that it’s lower case, but otherwise that’s exactly what that switch was designed for.

---

<div class="post-metadata">

**Author:** ![AllShookDown](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AllShookDown](https://boards.straightdope.com/u/AllShookDown)\
**Post date:** [January 14, 2005, 2:02pm UTC](https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702/3 "2005-01-14T14:02:37Z")

</div>

I’ve tried upper and lower case. Neither works. I’ve also tried putting it here:

XCOPY \*\*/k \*\* “g:\homedirectory"file name to copy.xls” “q:\MyDirectory"filename.xls” /r /y

(because it never seemed to work in my old batch files unless it was right behind the XCOPY)

and here:

XCOPY “g:\homedirectory"file name to copy.xls” “q:\MyDirectory"filename.xls” \*\*/k \*\* /r /y

which is where most or all the examples I’ve seen show the switches.

---

<div class="post-metadata">

**Author:** ![AllShookDown](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AllShookDown](https://boards.straightdope.com/u/AllShookDown)\
**Post date:** [January 14, 2005, 2:08pm UTC](https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702/4 "2005-01-14T14:08:19Z")

</div>

The file names I’m copying are the same, not different as shown in my example above.

---

<div class="post-metadata">

**Author:** ![AllShookDown](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AllShookDown](https://boards.straightdope.com/u/AllShookDown)\
**Post date:** [January 14, 2005, 3:21pm UTC](https://boards.straightdope.com/t/net-use-xcopy-and-the-k-switch/284702/5 "2005-01-14T15:21:14Z")

</div>

Problem solved. The /K switch was working fine. The problem was that I was using a subdirectory when I mapped the drive, and had that same subdirectory listed again when I was copying the file, so it was creating another directory.
