Loading ...
Sorry, an error occurred while loading the content.

848Re: Help Required: On system function

Expand Messages
  • pkaluski
    May 2, 2005
    • 0 Attachment
      Your original script worked for me.

      I have 2 questions:
      1. What is the result of "system" function?
      Try this code:
      if( system( "start mspaint ) ){
      print "Error from system function: $!";
      }

      2. Is Paint launched by your script?
      If yes, can you send me a screenshot of a title bar of Paint (send it
      to my private account, since yahoo groups do not accept attachments in
      posts)

      -Piotr

      --- In perlguitest@yahoogroups.com, "vishal_kharge"
      <vishal_kharge@y...> wrote:
      > Hello,
      >
      > I tried to use the following command:
      >
      > system("start C:\\windows\\mspaint");
      >
      > But still giving the same error.
      >
      > How I need to adjust the path?
      >
      > Thanks,
      > Vishal Kharge
      >
      > --- In perlguitest@yahoogroups.com, "Michael Rabinovitz"
      > <rabinov@y...> wrote:
      > > Vishal,
      > > Make sure you can launch mspaint from the command prompt. If
      you
      > > can't, you'll have to adjust your path. Alternatively, you could
      > > adjust your scripts 'system' command to:
      > > system("start C:\\windows\\mspaint");
      > > (you might have to make alterations for your configuration) and
      see
      > > if your script now runs.
      > >
      > > Good luck,
      > > Mike
      > >
      > > --- In perlguitest@yahoogroups.com, "vishal_kharge"
      > > <vishal_kharge@y...> wrote:
      > > > Hello ,
      > > >
      > > > I am getting the error "Could not find Paint" when I run the
      > > > following script:
      > > >
      > > > use strict;
      > > >
      > > > use Win32::GuiTest qw(:ALL);
      > > >
      > > > system("start mspaint");
      > > >
      > > > sleep 2;
      > > > my @windows = FindWindowLike(0, "Paint", "");
      > > > die "Could not find Paint\n" if not @windows;
      > > >
      > > >
      > > > I am using the ActivePerl for running the scripts.
      > > >
      > > > I think the statement: system("start mspaint"); is not getting
      > > > executed.
      > > >
      > > > What may be the reason and how should I solve this problem.
      > > >
      > > > Regards,
      > > > Vishal Kharge
    • Show all 7 messages in this topic