#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    Excute windows program within perl


    I would like to execute another windows program within perl that require input from the user. How do i automate the input process ?
    (for example calling a program called camstudio (known as screen recorder)

    Thanks
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Location
    spaceBAR Central
    Posts
    229
    Rep Power
    42
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    832
    Rep Power
    496
    There are several ways to do that, the most common ones are the system function or the backticks `cmd.exe $param1`.

    But what do you mean by input from the user?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    2
    Rep Power
    0

    Run Windows Program within Perl


    Originally Posted by Laurent_R
    There are several ways to do that, the most common ones are the system function or the backticks `cmd.exe $param1`.

    But what do you mean by input from the user?
    Let me explain.

    There are 2 issues:

    1. I have an icon that represent a utility program on my desktop. I want to run it within a perl script. When I go to the cmd.exe and type the program name(recorder.exe) it does not run for some reason.
    2. Assuming that I was successful in step one the program is waiting for the user input let's Alt F to select from the file menu one option and then run. I want the perl scrip to wait for 20 min and then shut down everything.
    Is this doable ??

    Thanks
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,937
    Rep Power
    1225
    When I go to the cmd.exe and type the program name(recorder.exe) it does not run for some reason.
    Fixing that is outside the scope of perl. Once you fix that, we can look at your second issue.

    For executing recorder.exe, I'd probably use IPC::Open3

    To simulate the pressing of the function key, I'd look at using Win32::GuiTest, however I've never used it, so you'd need to do some testing.

IMN logo majestic logo threadwatch logo seochat tools logo