Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

copy /un vs. copy /nu

May
10
3
Hi Rex ...

I ran into the following today -- it seems that copy /un tests the update process without copying anything, but copy /nu does the update and ignores the /n. I guess the /u must override it. I use this a lot and I always do /un, today I just happened to type it in the other order.

I imagine this is long-standing and may be WAD but if so it might be worth documenting as a behavior of /n. Is the rule just that /n should always be the last option, if used?

Example:

[c:\]ver /r
TCC LE 13.03.39 Windows XP [Version 5.1.2600]
TCC LE Build 39 Windows XP Build 2600 Service Pack 2

[c:\]md test
[c:\]echo hello > junk.txt
[c:\]*copy /un junk.txt test\
C:\junk.txt => C:\test\junk.txt
1 file would be copied

[c:\]*copy /nu junk.txt test\
C:\junk.txt => C:\test\junk.txt
1 file copied

Thanks,

Tom
 
Hi Rex ...

I ran into the following today -- it seems that copy /un tests the update process without copying anything, but copy /nu does the update and ignores the /n. I guess the /u must override it. I use this a lot and I always do /un, today I just happened to type it in the other order.

I imagine this is long-standing and may be WAD but if so it might be worth documenting as a behavior of /n. Is the rule just that /n should always be the last option, if used?

Example:
[c:\]ver /r
TCC LE 13.03.39 Windows XP [Version 5.1.2600]
TCC LE Build 39 Windows XP Build 2600 Service Pack 2
[c:\]md test
[c:\]echo hello > junk.txt
[c:\]*copy /un junk.txt test\
C:\junk.txt => C:\test\junk.txt
1 file would be copied
[c:\]*copy /nu junk.txt test\
C:\junk.txt => C:\test\junk.txt
1 file copied

Thanks,

Tom

Hi,

it seems to be even more funnier:
Code:
C:\...\TCCLE >md test
 
C:\...\TCCLE >echo hello > junk.txt
 
C:\...\TCCLE >*copy /un junk.txt test\
C:\Program Files (x86)\JPSoft\TCCLE\junk.txt => C:\Program Files (x86)\JPSoft\TCCLE\test\junk.txt
    1 file would be copied
 
C:\...\TCCLE >*copy /nu junk.txt test\
C:\Program Files (x86)\JPSoft\TCCLE\junk.txt => C:\Program Files (x86)\JPSoft\TCCLE\test\junk.txt
    1 file copied
 
C:\...\TCCLE >*copy /nu junk.txt test\
C:\Program Files (x86)\JPSoft\TCCLE\junk.txt => C:\Program Files (x86)\JPSoft\TCCLE\test\junk.txt
    1 file copied
 
C:\...\TCCLE >*copy /nu junk.txt test\
C:\Program Files (x86)\JPSoft\TCCLE\junk.txt => C:\Program Files (x86)\JPSoft\TCCLE\test\junk.txt
    1 file copied
 
C:\...\TCCLE >*copy /u junk.txt test\
    0 files copied
 
The /N option can take a number of suboptions: /NE, /NJ, /ND, and so on. It's not surprising that passing another option immediately after /N without an intervening switch character would confuse the parser.
 
yep.
I usually use /N as a seperate parameter. Just to make it evident to myself.

Code:
C:\...\TCCLE >*copy /n /u junk.txt test\
    0 files would be copied
 
The /N option can take a number of suboptions: /NE, /NJ, /ND, and so on. It's not surprising that passing another option immediately after /N without an intervening switch character would confuse the parser.

OK, I see that, the perils of overloading, but then there's not much room to maneuver in COPY. Sounds like /N? will ignore the second character if it is not one of the suboptions, rather than treating it as a new option. This also explains the behavior Frank reported. Now if I just had all the COPY options memorized ...
 
Back
Top