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

Author Topic: Answering yes when a bat file runs  (Read 25283 times)

0 Members and 1 Guest are viewing this topic.

llightsey

    Topic Starter


    Greenhorn

    Answering yes when a bat file runs
    « on: May 16, 2008, 08:20:07 AM »
    I am building a bat file to setup .net framework to run. When the command runs it ask if you are sure, it has a y & n. I want it to select y and run from there.

    blastman



      Hopeful

      Re: Answering yes when a bat file runs
      « Reply #1 on: May 16, 2008, 08:49:05 AM »
      does the .net framework install file support command line switching???

      if so there might be a slient switch.

      the best way to find out is to open the command prompt and loacte said install file, then;

      c:\loaction\of\instal\file\setup.exe /?


      hope it helps.

      Blastman, you are the man. Thank You Very Much!!!!!!!!!



      Sidewinder



        Guru

        Thanked: 139
      • Experience: Familiar
      • OS: Windows 10
      Re: Answering yes when a bat file runs
      « Reply #2 on: May 16, 2008, 09:06:36 AM »
      I deleted my earlier post. Apparently I misunderstood the question. If indeed the program is called setup, you can use the pipe to forcefeed the response.

      Example: echo Y | setup.exe

      Note: not all programs are written to accept data from the pipe.

       8)
      The true sign of intelligence is not knowledge but imagination.

      -- Albert Einstein

      AndrewH



        Greenhorn

        Re: Answering yes when a bat file runs
        « Reply #3 on: May 17, 2008, 05:37:02 AM »
        CHOSE = command 1 needs.
        If 1 does not've DOS 6 1 still has chose ;-)
        YN or ASK? or others.
        Or CHOSE = included + G.E.M. @ shaneland.

        llmeyer1000



          Intermediate

          Thanked: 1
          Re: Answering yes when a bat file runs
          « Reply #4 on: May 17, 2008, 07:20:06 AM »
          llightsey,
          Go to the CMD window and try blastman's  & Sidewinder's  suggestions.
          You may find that there is a silent switch, or you may be able to echo the y as Sidewinder suggested. Then you can incorporate the solution in you batch file.


          CHOSE = command 1 needs.
          If 1 does not've DOS 6 1 still has chose ;-)
          YN or ASK? or others.
          Or CHOSE = included + G.E.M. @ shaneland.

          Andrew,

          I think you meant Choice.com from DOS, NOT "CHOSE"
          Besides that, I don't think choice will help llightsey out here.

          blastman & Sidewinder both have viable suggestions that llightsey should pursue first.


          llightsey

            Topic Starter


            Greenhorn

            Re: Answering yes when a bat file runs
            « Reply #5 on: June 02, 2008, 11:44:16 AM »
            This is the bat file i want to run, when it runs it ask if i am sure and I answer YES. I don't want to type the yes in how can I make it auto answer the question and run?

            Bat file to allow a PC to run .net programs
            color 0a
            @cls

            c:
            cd \windows
            cd microsoft.net
            cd Framework
            cd v2.0.50727
            CasPol.exe -m -ag 1.2 -zone Intranet FullTrust set
            set PERSIS=/PERSISTENT:YES
            pause

            Sidewinder



              Guru

              Thanked: 139
            • Experience: Familiar
            • OS: Windows 10
            Re: Answering yes when a bat file runs
            « Reply #6 on: June 02, 2008, 12:22:42 PM »
            Did you research if there is a silent switch? You can try the pipe but there are no guarantees:

            Code: [Select]
            c:
            cd \windows\microsoft.net\Framework\v2.0.50727
            echo Y | CasPol.exe -m -ag 1.2 -zone Intranet FullTrust set
            set PERSIS=/PERSISTENT:YES
            pause

            If the program is expecting the fullword YES, then echo YES instead of Y.

             8)

            Any reason the set statement is after the program execute?

            The true sign of intelligence is not knowledge but imagination.

            -- Albert Einstein

            llightsey

              Topic Starter


              Greenhorn

              Re: Answering yes when a bat file runs
              « Reply #7 on: June 02, 2008, 12:52:08 PM »
              Sidewinder, it still wont run unless you type the YES in

              Sidewinder



                Guru

                Thanked: 139
              • Experience: Familiar
              • OS: Windows 10
              Re: Answering yes when a bat file runs
              « Reply #8 on: June 02, 2008, 01:01:35 PM »
              Well, like I mentioned, not all programs take input from the pipe. Unless you can find a switch for the program to run silently, you may SOL.

              Have you tried running the program from the Windows run box?

              Code: [Select]
              "c:\windows\microsoft.net\Framework\v2.0.50727\CasPol.exe -m -ag 1.2 -zone Intranet FullTrust set"

              It might be interesting to see if the shell gets activated for the prompt. You can set PERSIS anytime either temporarily thru the batch shell or permanently thru Windows.

              Good luck. 8)
              The true sign of intelligence is not knowledge but imagination.

              -- Albert Einstein

              llightsey

                Topic Starter


                Greenhorn

                Re: Answering yes when a bat file runs
                « Reply #9 on: June 02, 2008, 01:05:06 PM »
                I got it working I found the switch that turns the question off
                New Code

                Bat file to allow a PC to run .net programs
                color 0a
                @cls

                c:
                cd \windows\microsoft.net\Framework\v2.0.50727
                CasPol.exe -pp off -m -ag 1.2 -zone Intranet FullTrust

                Just change the _pp on and it will agin ask you  ;D

                Sidewinder



                  Guru

                  Thanked: 139
                • Experience: Familiar
                • OS: Windows 10
                Re: Answering yes when a bat file runs
                « Reply #10 on: June 02, 2008, 01:27:55 PM »
                It's always good to hear to success story. 8)
                The true sign of intelligence is not knowledge but imagination.

                -- Albert Einstein

                llightsey

                  Topic Starter


                  Greenhorn

                  Re: Answering yes when a bat file runs
                  « Reply #11 on: June 02, 2008, 01:37:34 PM »
                  Thanks for all your help on the Fourm Sidewinder