Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In cmd.exe if you type:

copy c:\a.txt

it will copy a.txt* (including a.txt1, a.txtb, etc).

How can I just copy a.txt?

share|improve this question
3  
Is it a modern version of Windows you're using, or actually MS-DOS? Because the cmd.exe command interpreter is not the same as DOS, it merely tries to be compatible. When I try the above command on Windows 7, it copies only a.txt, not a.txt1. –  Indrek Sep 27 '12 at 14:49
    
I'm using windows 7 –  nima Sep 27 '12 at 14:51
    
Is this the actual command you're using or just an example? –  Dennis Sep 27 '12 at 14:51
1  
No version of DOS or CMD that I am aware of would treat that command as having a wildcard without explicitly putting a wildcard in the command. –  EBGreen Sep 27 '12 at 14:51
1  
@nima: What's the name of the file that gets unintentionally copied? –  Dennis Sep 27 '12 at 15:06
show 1 more comment

1 Answer 1

up vote 0 down vote accepted

I don't know where you got that idea... DOS (all versions of) does not copy all files that start the same way without using a wild-card character. For example:

copy c:\a.txt x:\somewhere\else

will ONLY copy a.txt to that new location. The alternative:

copy c:\a.txt* x:\somewhere\else

will copy all files starting with a.txt to the new location. This would include a.txt1, a.txt2, and a.txtyourpantsareonfire.spitting.monkeys.bat.com.fish

share|improve this answer
    
This is not my idea, it's happening in front of my eyes :) –  nima Sep 27 '12 at 15:00
    
This is not the default behavior of any version of DOS. Perhaps something has become corrupted on your system, and/or perhaps you have some sort of bug on your machine. –  TheCompWiz Sep 27 '12 at 15:02
1  
The problem was in the path I used a / instead of \ before my file name. Thanks for your time. –  nima Sep 27 '12 at 15:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.