ksublondie has asked for the wisdom of the Perl Monks concerning the following question:
I have an exe I need to be able to automatically run and send an "enter" followed by an alt+F4 (close). Here's what I have so far:
use strict; use warnings; use lib 'f:\scripts524'; use English; my $cmd='CreateFile.exe'; my $pid = open CMD, '|-', $cmd or die $!; sleep 2; print CMD "\r"; print CMD "\n"; print CMD "\f"; print CMD hex '6B'; print CMD oct 153; close CMD; waitpid($pid,0);
My exe runs, but isn't getting the automated input. I haven't had much luck in my research so far. Is this even possible?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Run .exe and send input
by rjt (Curate) on Oct 29, 2019 at 21:47 UTC | |
Re: Run .exe and send input
by stevieb (Canon) on Oct 29, 2019 at 21:26 UTC | |
by ksublondie (Friar) on Oct 29, 2019 at 21:49 UTC | |
Re: Run .exe and send input
by GrandFather (Saint) on Oct 30, 2019 at 00:58 UTC |