Loading ...
Sorry, an error occurred while loading the content.

Re: [BATCH WORLD] Homework Question

Expand Messages
  • Michael Marquart
    Replaceable parameters are not used in the way you have used them - consider this batch file: @echo off echo %1 %2 %3 %4 %5 %6 %7 %8 %9 Save it as batch1.bat
    Message 1 of 7 , May 1, 2002
    • 0 Attachment
      Replaceable parameters are not used in the way you have used them -
      consider this batch file:

      @echo off
      echo %1 %2 %3 %4 %5 %6 %7 %8 %9

      Save it as batch1.bat ,for example, and then from the command line launch
      it like this.

      batch1 Quantum theory is way over my head - !


      Now save this batch file as batch2.bat

      @echo off
      echo %9 %8 %7 %6 %5 %4 %3 %2 %1

      and launch it like this

      batch2 Quantum theory is way over my head - !

      Can you see how the replaceable parameters work?

      Does that help you to unravel the puzzle?



      One item I should mention is that long filenames need special attention in
      a batch file, so for the moment don't use any spaces, commas, semicolons,
      etc in your filenames.



      On Tue, 30 Apr 2002 14:09:45 -0700 (PDT), mandrall stewart
      <decarlos69@...> wrote:

      >Michael,
      > Thank-you so much for responding to my question
      >because my instructor seems to be not responding . I
      >have all of those parts except for that extra %1. I
      >have written the bat. and it copies fine but when I
      >try to del my source file that I copied to my target
      >file I get an error message.I would like to learn more
      >on bat. files . DOS is like an old world that I have
      >never visited. Thank-you again and off the top of my
      >head
      >@echo off
      >Source file.txt %1
      >target file.txt %2
      >copy source file.txt target file.txt
      >del source file.txt
      >end.
      >
      >How's it look?
      >--- Michael Marquart <micm@...> wrote:
      >> You've stated it is homework - I am in two minds as
      >> to supplying a working
      >> batch file. Would it be better if I supply the
      >> pieces of the jigsaw and
      >> allow you to try and assemble them?
      >>
      >> Here are the pieces:
      >>
      >> @echo
      >> copy
      >> %1
      >> %2
      >> off
      >> %1
      >> del
      >>
      >>
      >> I'd be interested to hear how you go on this topic.
      >>
      >> --
      >> Regards,
      >> Michael
      >>
      >>
      >>
      >> On Fri, 26 Apr 2002 19:53:35 -0000, "decarlos69"
      >> <decarlos69@...>
      >> wrote:
      >>
      >> >I am trying to make a batch file that takes a
      >> source file and a
      >> >target file name as two parameters and move then
      >> move the source file
      >> >to the target file by first copying the source to
      >> the target and then
      >> >by deleting the source file.Can anyone help me I am
      >> new To this.
      >>
      >>
      >
      >
      >__________________________________________________
      >Do You Yahoo!?
      >Yahoo! Health - your guide to health and wellness
      >http://health.yahoo.com
      >
      >
      >To Post a message, send it to: batchworld@...
      >
      >To Unsubscribe, send a blank message to: batchworld-unsubscribe@...
      >
      >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    • mandrall stewart
      Michael, I tried what you said to try and I did figure out what that really means. For my homework I wrote three small bat. files and hopefully that is what
      Message 2 of 7 , May 2, 2002
      • 0 Attachment
        Michael,
        I tried what you said to try and I did
        figure out what that really means. For my homework I
        wrote three small bat. files and hopefully that is
        what the teacher wanted. I must thank-u for ur time
        and help on this subject.



        --- Michael Marquart <micm@...> wrote:
        > Replaceable parameters are not used in the way you
        > have used them -
        > consider this batch file:
        >
        > @echo off
        > echo %1 %2 %3 %4 %5 %6 %7 %8 %9
        >
        > Save it as batch1.bat ,for example, and then from
        > the command line launch
        > it like this.
        >
        > batch1 Quantum theory is way over my head - !
        >
        >
        > Now save this batch file as batch2.bat
        >
        > @echo off
        > echo %9 %8 %7 %6 %5 %4 %3 %2 %1
        >
        > and launch it like this
        >
        > batch2 Quantum theory is way over my head - !
        >
        > Can you see how the replaceable parameters work?
        >
        > Does that help you to unravel the puzzle?
        >
        >
        >
        > One item I should mention is that long filenames
        > need special attention in
        > a batch file, so for the moment don't use any
        > spaces, commas, semicolons,
        > etc in your filenames.
        >
        >
        >
        > On Tue, 30 Apr 2002 14:09:45 -0700 (PDT), mandrall
        > stewart
        > <decarlos69@...> wrote:
        >
        > >Michael,
        > > Thank-you so much for responding to my
        > question
        > >because my instructor seems to be not responding .
        > I
        > >have all of those parts except for that extra %1. I
        > >have written the bat. and it copies fine but when I
        > >try to del my source file that I copied to my
        > target
        > >file I get an error message.I would like to learn
        > more
        > >on bat. files . DOS is like an old world that I
        > have
        > >never visited. Thank-you again and off the top of
        > my
        > >head
        > >@echo off
        > >Source file.txt %1
        > >target file.txt %2
        > >copy source file.txt target file.txt
        > >del source file.txt
        > >end.
        > >
        > >How's it look?
        > >--- Michael Marquart <micm@...> wrote:
        > >> You've stated it is homework - I am in two minds
        > as
        > >> to supplying a working
        > >> batch file. Would it be better if I supply the
        > >> pieces of the jigsaw and
        > >> allow you to try and assemble them?
        > >>
        > >> Here are the pieces:
        > >>
        > >> @echo
        > >> copy
        > >> %1
        > >> %2
        > >> off
        > >> %1
        > >> del
        > >>
        > >>
        > >> I'd be interested to hear how you go on this
        > topic.
        > >>
        > >> --
        > >> Regards,
        > >> Michael
        > >>
        > >>
        > >>
        > >> On Fri, 26 Apr 2002 19:53:35 -0000, "decarlos69"
        > >> <decarlos69@...>
        > >> wrote:
        > >>
        > >> >I am trying to make a batch file that takes a
        > >> source file and a
        > >> >target file name as two parameters and move then
        > >> move the source file
        > >> >to the target file by first copying the source
        > to
        > >> the target and then
        > >> >by deleting the source file.Can anyone help me I
        > am
        > >> new To this.
        > >>
        > >>
        > >
        > >
        > >__________________________________________________
        > >Do You Yahoo!?
        > >Yahoo! Health - your guide to health and wellness
        > >http://health.yahoo.com
        > >
        > >
        > >To Post a message, send it to:
        > batchworld@...
        > >
        > >To Unsubscribe, send a blank message to:
        > batchworld-unsubscribe@...
        > >
        > >Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        > >
        > >
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Yahoo! Health - your guide to health and wellness
        http://health.yahoo.com
      • Michael Marquart
        On Thu, 2 May 2002 14:09:07 -0700 (PDT), mandrall stewart ... I m glad to be of assistance. How about you post your batch files here? You may get some further
        Message 3 of 7 , May 3, 2002
        • 0 Attachment
          On Thu, 2 May 2002 14:09:07 -0700 (PDT), mandrall stewart
          <decarlos69@...> wrote:

          >Michael,
          > I tried what you said to try and I did
          >figure out what that really means. For my homework I
          >wrote three small bat. files and hopefully that is
          >what the teacher wanted. I must thank-u for ur time
          >and help on this subject.

          I'm glad to be of assistance.

          How about you post your batch files here? You may get some further ideas
          or comments on your batchs.


          >> >--- Michael Marquart <micm@...> wrote:
          >> >> Here are the pieces:
          >> >>
          >> >> @echo
          >> >> copy
          >> >> %1
          >> >> %2
          >> >> off
          >> >> %1
          >> >> del
          >> >>
          >> >> On Fri, 26 Apr 2002 19:53:35 -0000, "decarlos69"
          >> >> <decarlos69@...>
          >> >> wrote:
          >> >>
          >> >> >I am trying to make a batch file that takes a
          >> >> source file and a
          >> >> >target file name as two parameters and move then
          >> >> move the source file
          >> >> >to the target file by first copying the source
          >> to
          >> >> the target and then
          >> >> >by deleting the source file.Can anyone help me I
          >> am
          >> >> new To this.
        • badmofoka
          Hey Guru s... How can I set the users environment variable called path through a login script? I want this to be set automatically every time the user runs
          Message 4 of 7 , May 6, 2002
          • 0 Attachment
            Hey Guru's...

            How can I set the users environment variable called path through a login
            script? I want this to be set automatically every time the user runs their
            login scripts. I have tried passing this but it will only reside in the
            window that is running the script.

            Ideas?

            Thanks!

            Jon
          Your message has been successfully submitted and would be delivered to recipients shortly.