Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: New DOS user need help with copy command  (Read 3598 times)

0 Members and 1 Guest are viewing this topic.

fisherman2

    Topic Starter


    Greenhorn

    • Experience: Beginner
    • OS: Windows 7
    New DOS user need help with copy command
    « on: July 12, 2013, 01:02:43 AM »
    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.

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: New DOS user need help with copy command
    « Reply #1 on: July 12, 2013, 04:06:15 AM »
    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)
    « Last Edit: July 12, 2013, 04:18:54 AM by foxidrive »

    fisherman2

      Topic Starter


      Greenhorn

      • Experience: Beginner
      • OS: Windows 7
      Re: New DOS user need help with copy command
      « Reply #2 on: July 12, 2013, 12:46:02 PM »
      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.  :)

      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Re: New DOS user need help with copy command
      « Reply #3 on: July 12, 2013, 01:45:21 PM »
      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).

      Ocalabob



        Rookie

        Thanked: 4
        • Experience: Familiar
        • OS: Windows 7
        Re: New DOS user need help with copy command
        « Reply #4 on: July 12, 2013, 06:33:15 PM »
        @foxidrive
        Good job netting that question. I was concerned that Salmon Trout
        might get hooked on the OP's thread. :)

        foxidrive



          Specialist
        • Thanked: 268
        • Experience: Experienced
        • OS: Windows 8
        Re: New DOS user need help with copy command
        « Reply #5 on: July 12, 2013, 06:51:17 PM »
        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. ;)