Send keystrokes to a running program via batch file

This is a discussion on Send keystrokes to a running program via batch file within the Windows Programming forums, part of the Platform Specific Boards category; Hi! I am trying to create a batch file, that would start a external dos application and then feed the ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    2

    Send keystrokes to a running program via batch file

    Hi!
    I am trying to create a batch file, that would start a external dos application and then feed the application a few "ENTER" keystrokes, but cant get it working. The application dosent want to take the keystrokes. Any ideas?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    Use something else?
    Getting almost anything useful done in a batch file always seems like far more effort than it ought to.

    How about posting what you tried?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    2
    I had to use a batch because, a program that i am using needs to read a patch file in. But, i think i got it working already. Tested many different programs, that are made for just this purpose. Non of the newest programs worked, but a simple old one did the job just fine. The program name is Keypress.com. I put the next code inside a batch file and it worked nicely:

    Keypress /R (R stands for ENTER)
    program name

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21