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

Author Topic: Auto run .exe file and answer yes to questions  (Read 30204 times)

0 Members and 1 Guest are viewing this topic.

malshika

    Topic Starter


    Starter

    Thanked: 1
    Auto run .exe file and answer yes to questions
    « on: September 20, 2009, 02:14:15 AM »
    i have a .exe program i have to run this program automatically. So i can run this .exe file by creating a bat file and  schedule windows scheduler, no problem about that. But when i am running this .exe file it prompt a question would you like to continue this program How can i set yes to this .exe file?

    Using the .bat file how to automate this process?

    Helpmeh



      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Re: Auto run .exe file and answer yes to questions
    « Reply #1 on: September 20, 2009, 05:11:22 AM »
    I don't think this is possible unless it has a switch to suppress prompting.
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    Salmon Trout

    • Guest
    Re: Auto run .exe file and answer yes to questions
    « Reply #2 on: September 20, 2009, 06:03:32 AM »
    What is the exe file and how does it ask the question? Does it show a "yes" button? Or "Yes" and "No" buttons? More details please!

    malshika

      Topic Starter


      Starter

      Thanked: 1
      Re: Auto run .exe file and answer yes to questions
      « Reply #3 on: September 20, 2009, 06:28:35 AM »
      its is a third party product software. i want to take backup using windows scheduler.
      i am running (pdm_backup -d -f filename )  as a command then it prompt would u like to continue (y/n):
      if i can enter 'y " using a bat file it is great. it will run the backup normally when i enter "y"  .

      thanks if anybody can help to resolve this poblem great.

      Salmon Trout

      • Guest
      Re: Auto run .exe file and answer yes to questions
      « Reply #4 on: September 20, 2009, 06:31:33 AM »
      you could try using a pipe and passing the y through it like this

      echo Y | pdm_backup -d -f filename

      or

      "redirection" from a file

      echo Y>y.txt
      Y.txt<pdm_backup -d -f filename
      « Last Edit: September 20, 2009, 06:48:52 AM by Salmon Trout »

      Salmon Trout

      • Guest
      Re: Auto run .exe file and answer yes to questions
      « Reply #5 on: September 20, 2009, 06:48:00 AM »
      [UPDATE]

      The pipe technique is recommended in this thread here

      http://www.helpdeskusers.com/e107_plugins/forum/forum_viewtopic.php?14393

      Although they use single quotes around the Y (dunno why) so I suggest trying with and without quotes

      Code: [Select]
      echo 'Y' | pdm_backup

      Salmon Trout

      • Guest
      Re: Auto run .exe file and answer yes to questions
      « Reply #6 on: September 20, 2009, 06:49:14 AM »
      .

      malshika

        Topic Starter


        Starter

        Thanked: 1
        Re: Auto run .exe file and answer yes to questions
        « Reply #7 on: September 20, 2009, 06:52:28 AM »
        Great.Thank you salmon using the first suggestion i am able to take backup without quotes.

        Thanks again.

        Salmon Trout

        • Guest
        Re: Auto run .exe file and answer yes to questions
        « Reply #8 on: September 20, 2009, 06:58:02 AM »
        Great.Thank you salmon using the first suggestion i am able to take backup without quotes.

        Thanks again.

        You are very welcome.

        Helpmeh



          Guru

        • Roar.
        • Thanked: 123
          • Yes
          • Yes
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 8
        Re: Auto run .exe file and answer yes to questions
        « Reply #9 on: September 20, 2009, 06:58:31 AM »
        Nice triple-post salmon.

        So, the piped output goes to the first user input, in this case, a confirmation. Is there a way to make it go to the second?

        Like for my first user-input, I need to say start, then for the second, it needs to say Y, just like the OP.
        Where's MagicSpeed?
        Quote from: 'matt'
        He's playing a game called IRL. Great graphics, *censored* gameplay.

        Salmon Trout

        • Guest
        Re: Auto run .exe file and answer yes to questions
        « Reply #10 on: September 20, 2009, 07:02:58 AM »
        Nice triple-post salmon.

        It's because they changed the buttons around. I intend to hit "modify" and hit "quote" by mistake, and cannot afterwards delete it.

        Salmon Trout

        • Guest
        Re: Auto run .exe file and answer yes to questions
        « Reply #11 on: September 20, 2009, 07:04:47 AM »
        So, the piped output goes to the first user input, in this case, a confirmation. Is there a way to make it go to the second?

        Like for my first user-input, I need to say start, then for the second, it needs to say Y, just like the OP.

        need more info; like what kind of program, and how you are running it etc.

        Helpmeh



          Guru

        • Roar.
        • Thanked: 123
          • Yes
          • Yes
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 8
        Re: Auto run .exe file and answer yes to questions
        « Reply #12 on: September 20, 2009, 07:27:03 AM »
        It used to be a batch file, now its an EXE. 

        It basically asks you to begin, it sorts the files then asks you if you want to delete the originals (it copies the files, not moves).
        Where's MagicSpeed?
        Quote from: 'matt'
        He's playing a game called IRL. Great graphics, *censored* gameplay.

        Salmon Trout

        • Guest
        Re: Auto run .exe file and answer yes to questions
        « Reply #13 on: September 20, 2009, 07:33:11 AM »
        It used to be a batch file, now its an EXE. 

        In that case, I'd rewrite and recompile the batch. Perhaps using passed parameters %1, %2, etc. Piping only works for the first prompt which takes characters from STDIN.

        macdad-



          Expert

          Thanked: 40
          Re: Auto run .exe file and answer yes to questions
          « Reply #14 on: September 20, 2009, 03:21:33 PM »
          Besides piping, you cant send keys to an exe.
          If you dont know DOS, you dont know Windows...

          Thats why Bill Gates created the Windows NT Family.