Copying Files in Command Prompt


#1

I know its syntax like: [drive letter]:\>copy [filename] [destination]

but how to copy a file, like "drivers collection.rar", or any other file having spaces?


#2

^ you know the syntax for that too

you have just written "drivers collection.rar"

it will be like

[drive letter]:\>copy "c:\program files\filen name.txt" [destination]


#3

it's giving an error:

"the system cannot find the specified file"


#4

you might have TYPO in in the file name or path. recheck the spellings or full path.

but file names or full paths with spaces are dealt with " double quotes aside them.


#5

[quote=", post:, topic:"]

file names or full paths with spaces are dealt with " double quotes aside them.
[/quote]

["] was the mistake…thanx :)


#6

@ coolrizzzi

Why are you trying to copy files using command prompt? Why not Windows Explorer (or My Computer)'s copy/paste?

Copy/Paste of Windows is much praised because it make life easier.

For Copy command in command prompt, you use double-quotes if it has space.

Following is an example, (if files doesn't exist on your computer then it will produce error):

C:\>copy "c:\program files\windows media player\wmplayer.exe" "%userprofile%\desktop"

Note that I am using %userprofile%. If you don't know then get help from Microsoft KB or Google it. Command Prompt (CMD), or PowerShell can be very helpful if you know commands. By the way, just for your example, I am using full "c:\program files\" name instead of $ProgramFiles% :)

Good luck!


#7

[quote=", post:, topic:"]

@ coolrizzzi

Why are you trying to copy files using command prompt? Why not Windows Explorer (or My Computer)'s copy/paste?

[/quote]

Sometimes Windows Explorer fails to copy certain files from cds/dvds, but command prompt’s “copy” works always(if cd/dvd is burned well)…


#8

use "xcopy source destination" for better parameters


#9

[quote=", post:, topic:"]

use “xcopy source destination” for better parameters
[/quote]

thanx! I have started copying the file through “xcopy” because “Copy” command was not working previously, it was giving the error “invalid function”…lets see if it copies or not


#10

nope! :(

error:

"file creation error - incorrect function"

I think that dvd is not burned properly! because its a .rar file, i've tried extracting it from dvd but "no success":(

chalo! np! thnx for your comments guys.


#11

[quote=", post:, topic:"]

Sometimes Windows Explorer fails to copy certain files from cds/dvds, but command prompt’s “copy” works always(if cd/dvd is burned well)…

[/quote]

Whoever told you that actually misguided you. It is one of false urban legends. In Windows NT based system, “Copy” command and “Windows Explorer”'s copy/paste uses same Windows API. In background the same API is used for most of copying-files programs. If one fails so will others.

If you trying to copy from CD/DVD. First clean it. There is a proper method of cleaning discs (Google it). Make image of your disc; try using ImgBurn, Nero, or Alcohol 120% etc. They can try to read bad-sectors with retries. After image is created (maybe after several hours). Then mount your image and copy from there.

Some CD/DVD drives can read data from bad discs better than others. Try your CD/DVD into another manufacturers/models drive.

Good luck!


#12

[quote=", post:, topic:"]

Some CD/DVD drives can read data from bad discs better than others. Try your CD/DVD into another manufacturers/models drive.

Good luck!

[/quote]

Yup! I tried the same dvd with sony, benq and laptop’s dvd rom drive! but none of them can read the data…the thing is that windows explorer and command prompt[dir] shows files but fails to copy them!

Going to try image method!


#13

The problem is that your dvd has not been written properly. In that case, what happens is that you can always see your files in the dvd after burning but if there are errors in the process of burning, you are not at all able to copy your files from the dvd to anywhere. I always put this little utility in the dvd at last moment called cdcrc.exe Google it and you will know how to use it.