Net use, XCOPY and the /K switch

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.

/k should work. :confused:

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

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.

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

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.