1.

Solve : New DOS user need help with copy command?

Answer»

How would you view only the .com files in the C:\windows\system32 directory?
How would you copy all the .com files in the C:\windows\system32 directory to a directory named JUNK?

I am new to computers and taking an intro class and not getting this. Would appreciate your assistance.It's nice to see someone learning, and to say so. Some people try to get homework done by subterfuge.

How would you view only the .com files in the C:\windows\system32 directory?

dir "C:\windows\system32\*.com" /b /a-d

The /b is optional (which returns only the brief names) and so is the /a-d (which is designed to eliminate any folders that end in .com)

Try the COMMAND to see how it looks with and without the /b in it. The /a-d is UNLIKELY to make a difference in this case, but you can add /p to make it pause on every screen full.

How would you copy all the .com files in the C:\windows\system32 directory to a directory named JUNK?

copy "C:\windows\system32\*.com" "c:\junk"

This assumes you have permissions to create a JUNK folder in the root of c: (and that it already exists)
Thank you very much for your assistance. I know see how it is done and feel more confident in my abilities. My lack of understanding was with the quotation marks. Thanks again for getting me on my way. You're welcome.

One point I should make clear is that while the quotation marks can always be used, but they are only needed when the path or filespec contains spaces and & characters (and when using environment variables that CONTAIN spaces and any other 'poison' characters).@foxidrive
Good job netting that QUESTION. I was concerned that Salmon Trout
might get hooked on the OP's thread. That's a pearl-er! If you see a shark LURKING around, don't let him put the bite on you for a few squid.



Discussion

No Comment Found