priyaviswam has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Here Im trying to access the Grapphics properties->display settings to rotate the screen. For this im using the GfxUI.exe in my 64 bit machine. But unfortunately this is not lauching through perl Proc::Background. Here the code I tried which is working fine on the 32 bit machine. But it is not working on 64 bit machine. Please note: For 32 bit machine the exe used is different from 64 bit.

use strict; use warnings; use Proc::Background; my $Loc = "C:\\Windows\\Sysnative\\igfxcfg.exe"; my $Status = Proc::Background->new($Loc); print "Status = $Status\n";
Please let me know your suggestion

Replies are listed 'Best First'.
Re: unable to launch GfxUI.exe using Proc::Background
by Corion (Patriarch) on May 15, 2012 at 11:20 UTC

    Can you launch the program via system?

    If no, there is a permission problem or the program does not exist in the place you think it exists.

    If yes, you can simply launch it in the background by using the system(1, ...) form of launching on Windows:

    system(1, $Loc) == 0 or warn "Couldn't launch '$Loc': $! / $? / $^E";
Re: unable to launch GfxUI.exe using Proc::Background
by Anonymous Monk on May 15, 2012 at 10:29 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: unable to launch GfxUI.exe using Proc::Background
by Khen1950fx (Canon) on May 15, 2012 at 10:58 UTC
    I'm on a Linux machine, so I can't speak for Win32. Try a different approach. For example:
    #!/usr/bin/perl use strict; use warnings; use Proc::Background; use vars qw(@ISA); @ISA = qw(Proc::Background); use Data::Dumper::Concise; my $loc = '/bin/ps'; my $proc1 = Proc::Background->new($loc); $proc1->wait; my $time1 = $proc1->start_time; my $time2 = $proc1->end_time; print "Status: \n", "end_time: ", Dumper($time2);

      Thanks for the post. In the approach you mentioned, the line

      my $proc1 = Proc::Background->new($loc); $proc1->wait;
      which is almost the same I have used in my code,is not launching the Graphics UI also did not return anything.