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

Author Topic: SET yourname?  (Read 2008 times)

0 Members and 1 Guest are viewing this topic.

Google

    Topic Starter


    Mentor

    Thanked: 2
    • Certifications: List
    • Experience: Experienced
    • OS: Windows 7
    SET yourname?
    « on: August 10, 2006, 08:02:31 AM »
    Is there some way I could have a batch file echo "type your name" and then in another part of the batchfile it would fill in thier name?:
    Code: [Select]
    @echo off
    echo Type your name:
    pause
    Hi, %yourname%
    ???????????????????????????????????????????????????????????????????????????????????????????????????

    GuruGary



      Adviser
      Re: SET yourname?
      « Reply #1 on: August 10, 2006, 08:46:05 AM »
      You can use this:
      Code: [Select]
      @echo off
      set /p Name=Type your name:
      echo Hi, %Name%

      Google

        Topic Starter


        Mentor

        Thanked: 2
        • Certifications: List
        • Experience: Experienced
        • OS: Windows 7
        Re: SET yourname?
        « Reply #2 on: August 10, 2006, 10:20:35 AM »
        thanks, but wat does the /p do?

        Google

          Topic Starter


          Mentor

          Thanked: 2
          • Certifications: List
          • Experience: Experienced
          • OS: Windows 7
          Re: SET yourname?
          « Reply #3 on: August 10, 2006, 10:55:07 AM »
          I also figured out this code:
          Code: [Select]
          @echo off
          set /p g1=Type a girls name:
          cls
          set /p g2=Type another girls name:
          cls
          set /p g3=Type one more girls name:
          cls
          set /p b1=Type a boys name:
          cls
          set /p b2=Type another boys name:
          cls
          set /p b3=Type one more boys name:
          cls
          set /p l1=Type something you can do to a lemon:
          cls
          set /p l2=Type something else you can do to a lemon:
          cls
          set /p l3=Type one more thing you can do to a lemon:
          cls
          set /p bp1=Type a body part:
          cls
          set /p bp2=Type another body part:
          cls
          set /p bp3=Type one more body part:
          cls
          set /p p1=Type a place:
          cls
          set /p p2=Type another place:
          cls
          set /p p3=Type one more place:
          pause
          cls
          echo  %b3% and %g2% are %l2%ing each others %bp3% in the %p2%!
          pause
          cls
          echo %b1% and %g3% are %l3%ing each others %bp2% in the %p1%!
          pause
          cls
          echo %b2% and %g1% are %l1%ing each others %bp1% in the %p3%!
          pause
          cls
          echo hahahahahahahahahahahahahaha
          pause
          exit
          Except how could I make it match up randomly like the highlighted area:
          Code: [Select]
          @echo off
          set /p g1=Type a girls name:
          cls
          set /p g2=Type another girls name:
          cls
          set /p g3=Type one more girls name:
          cls
          set /p b1=Type a boys name:
          cls
          set /p b2=Type another boys name:
          cls
          set /p b3=Type one more boys name:
          cls
          set /p l1=Type something you can do to a lemon:
          cls
          set /p l2=Type something else you can do to a lemon:
          cls
          set /p l3=Type one more thing you can do to a lemon:
          cls
          set /p bp1=Type a body part:
          cls
          set /p bp2=Type another body part:
          cls
          set /p bp3=Type one more body part:
          cls
          set /p p1=Type a place:
          cls
          set /p p2=Type another place:
          cls
          set /p p3=Type one more place:
          pause
          cls
          echo  %b3% and %g2% are %l2%ing each others %bp3% in the %p2%!
          pause
          cls
          echo %b1% and %g3% are %l3%ing each others %bp2% in the %p1%!
          pause
          cls
          echo [highlight]%b2% and %g1% are %l1%ing each others %bp1% in the %p3%![/highlight]pause
          cls
          echo hahahahahahahahahahahahahaha
          pause
          exit
          How could I make it so that it's not always %b2%, %g1%, %l1% %bp1% and %p3% matching up with each other???