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

Re: Help Required: On system function

Expand Messages
  • Michael Rabinovitz
    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
    Message 1 of 7 , May 1, 2005
    • 0 Attachment
      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
    • vishal_kharge
      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,
      Message 2 of 7 , May 1, 2005
      • 0 Attachment
        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
      • vishal_kharge
        Hello, By increasing the delay time, its still not working. Thanks, Vishal K ... (instead
        Message 3 of 7 , May 2, 2005
        • 0 Attachment
          Hello,

          By increasing the delay time, its still not working.

          Thanks,
          Vishal K

          --- In perlguitest@yahoogroups.com, "pkaluski" <pkaluski@p...> wrote:
          > I would try giving it more time. Try to sleep for 10 seconds
          (instead
          > of 2) and see if it helps
          > -Piotr
          >
          >
          >
          >
          > --- 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
        • pkaluski
          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
          Message 4 of 7 , 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
          Your message has been successfully submitted and would be delivered to recipients shortly.