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

Author Topic: MS DOS command  (Read 5497 times)

0 Members and 1 Guest are viewing this topic.

Wiehoo

    Topic Starter


    Starter

    • Experience: Experienced
    • OS: Windows 7
    MS DOS command
    « on: October 11, 2010, 07:19:05 AM »
    Hello,

    First of all, excuse me for my bad English..

    I’m studying for ICT and I’m having problem with a batch file I need to create in MS DOS.
    I need a command when you type in for example CA B it copies only files which begin with the letter B to disk A.
    And the command only needs to copy the files in the directory where it is at that moment.

    I’m not sure if it’s useful to know, but I’m working in Vmware player.

    I hope someone can help me with this command!

    Thanks!

    Best regards,

    Iris

    Allan

    • Moderator

    • Mastermind
    • Thanked: 1260
    • Experience: Guru
    • OS: Windows 10
    Re: MS DOS command
    « Reply #1 on: October 11, 2010, 07:23:58 AM »
    1) Your English is excellent. Far better, I'm ashamed to say, than many native-born Americans who post on these forums.
    2) One command would be: Copy b*.* a:\
    Note there is a space between the last asterisk and the letter "a"
    « Last Edit: October 11, 2010, 07:47:33 AM by Allan »

    Wiehoo

      Topic Starter


      Starter

      • Experience: Experienced
      • OS: Windows 7
      Re: MS DOS command
      « Reply #2 on: October 11, 2010, 07:46:48 AM »
      Hello Allan,

      Thanks for your compliment! I come from the Netherlands, so I'm doing my best!

      The teacher told us to use shift commands for this command.
      Cause if I use copy b*.* a:\ it only will copy files beginning with the letter b.
      I need a command which asks the user to enter a desired letter and that the program will copy the files beginning with the desired letter.

      Do you perhaps know how this command should look like?

      Thanks again :)

      Regards,

      Iris

      Allan

      • Moderator

      • Mastermind
      • Thanked: 1260
      • Experience: Guru
      • OS: Windows 10
      Re: MS DOS command
      « Reply #3 on: October 11, 2010, 07:48:52 AM »
      Sorry - I misunderstood the question. I'm too many years removed from DOS to help with any but the simplest of commands. Hang around though, we have plenty of knowledgeable folks who will be around during the day.

      Wiehoo

        Topic Starter


        Starter

        • Experience: Experienced
        • OS: Windows 7
        Re: MS DOS command
        « Reply #4 on: October 11, 2010, 07:51:33 AM »
        I hope so!
        Thanks for your help!


        gpl



          Apprentice
        • Thanked: 27
          Re: MS DOS command
          « Reply #5 on: October 11, 2010, 09:28:32 AM »
          Hi Iris
          If you are running pure MSDOS, then it will not be easy to help you, however if you are running a command shell from windows (XP and up) then the following should be what you want
          Code: [Select]
          @Echo Off
          :Loop
          Set Resp=
          Set /P Resp=Which Letter:
          If "%Resp%"=="" GoTo Loop
          Copy %Resp%*.* A:

          This tests for the user not entering anything, but does not stop them entering more than 1 character.
          Does this help ?
          Graham

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: MS DOS command
          « Reply #6 on: October 11, 2010, 07:45:50 PM »
          It's pure DOS, using the shift command.

          I really don't see why one would need the shift command for this, It can be used to allow for multiple letters, though.

          Code: [Select]
          :START
          if !%1==! goto EXIT
          for %%P in (%1*.*) do copy %%P A:\
          shift
          goto START
          :EXIT

          EDIT: also, for pure DOS, it would be impossible to have a "prompt" like command, without a third-party utility. Excepting choice, but for this application choice would be pretty clumsy.
          I was trying to dereference Null Pointers before it was cool.

          Salmon Trout

          • Guest
          Re: MS DOS command
          « Reply #7 on: October 12, 2010, 02:54:46 AM »
          1) Your English is excellent. Far better, I'm ashamed to say, than many native-born Americans who post on these forums.

          Not to mention the Brits?

          Allan

          • Moderator

          • Mastermind
          • Thanked: 1260
          • Experience: Guru
          • OS: Windows 10
          Re: MS DOS command
          « Reply #8 on: October 12, 2010, 05:48:45 AM »
          Not to mention the Brits?
          I have to say that I am constantly appalled and embarrassed by the way the English language is butchered on these forums by young people for whom English is their first language. And in most cases they simply don't care. Where do they expect to go in life if they can't communicate intelligently? I could literally do a BC Programmer type post on what I've seen and how I feel about it, but I think you know what I'm talking about.

          Wiehoo

            Topic Starter


            Starter

            • Experience: Experienced
            • OS: Windows 7
            Re: MS DOS command
            « Reply #9 on: October 12, 2010, 10:05:51 AM »
            Hello!

            Thank you all for your help.
            Thursday I have to go to school and ask the teacher for more information.

            Thanks again!

            Best regards,

            Iris

            Salmon Trout

            • Guest
            Re: MS DOS command
            « Reply #10 on: October 16, 2010, 02:39:50 AM »
            I have to say that I am constantly appalled and embarrassed by the way the English language is butchered on these forums by young people for whom English is their first language. And in most cases they simply don't care. Where do they expect to go in life if they can't communicate intelligently? I could literally do a BC Programmer type post on what I've seen and how I feel about it, but I think you know what I'm talking about.

            I have thought about this, and I believe that compared to before email, the web, SMS etc came along, many more people are writing things for others to read. Consider: it has always been the case that many people, even after completing education to preuniversity level (and beyond!), have writing skills that can at best be described as rudimentary. In general this does (or did) not matter. Their written output consisted of perhaps shopping lists and the (very) occasional letter or postcard. Now they can create material about their computer problems, what they think of President Obama, their chosen soccer team, whatever, and often it is not a pretty sight.


            Merv Wiz



              Starter

              • Experience: Beginner
              • OS: Unknown
              Re: MS DOS command
              « Reply #11 on: November 10, 2010, 06:08:59 AM »
              Not to mention the Brits?

              I say old chap I'm ENGLISH we don't like being called Brits There are four countrys in Britain and they are to differing degrees self governing.

              BC_Programmer


                Mastermind
              • Typing is no substitute for thinking.
              • Thanked: 1140
                • Yes
                • Yes
                • BC-Programming.com
              • Certifications: List
              • Computer: Specs
              • Experience: Beginner
              • OS: Windows 11
              Re: MS DOS command
              « Reply #12 on: November 10, 2010, 06:21:08 AM »
              I say old chap I'm ENGLISH we don't like being called Brits There are four countrys in Britain and they are to differing degrees self governing.

              Are you telling him what he doesn't like being called? Isn't that a bit presumptious?





              I was trying to dereference Null Pointers before it was cool.

              Salmon Trout

              • Guest
              Re: MS DOS command
              « Reply #13 on: November 10, 2010, 10:44:12 AM »
              I say old chap I'm ENGLISH we don't like being called Brits There are four countrys in Britain and they are to differing degrees self governing.

              1. I was replying to this remark

              Quote
              Your English is excellent. Far better, I'm ashamed to say, than many native-born Americans who post on these forums.

              He said native-born Americans, not Californians or New Yorkers or Kentuckians, who are, also, to "differing degrees" self-governing within one nation state. So I responded likewise.

              2. I am a Brit, I live in Bristol, and I don't mind at all being called a "Brit". I do object strongly to the type of person who shoves the flag of St George down my throat and bangs on about "Engerland".

              3. The plural of "country" is "countries".

              4. There are three countries, England, Scotland and Wales, which are on the island known as Great Britain, and one province, Northern Ireland, which isn't, which together make up the United Kingdom Of Great Britain and Northern Ireland.

              5. No charge for the geography and spelling lessons.

              6. Thanks for proving our point.

              7.  ::)
              « Last Edit: November 10, 2010, 10:58:42 AM by Salmon Trout »