in reply to Stop a .exe
You can open a pipe to the program (see perlopentut), and print a newline to the pipe. With a bit of luck, that has the same effect than pressing Enter.