in reply to Re^2: Launch an exe using system
in thread Launch an exe using system

You will need to supply proper quotes to the start command:

my $cmd = qq{start "C:\\Program Files (x86)\\Microsoft LifeCam\\LifeCa +m.exe"}; system($cmd) == 0 or die "Couldn't launch [$cmd]: $! / $?";

Alternatively, you can use the form of system(1, ...) as documented in perlport:

system( 1, $cmd ) ...

Replies are listed 'Best First'.
Re^4: Launch an exe using system
by priyaviswam (Sexton) on Nov 14, 2011 at 11:24 UTC

    Thanks of the response. I tried the following code :

    my $LifeCamLoc = "C:\\Program Files (x86)\\Microsoft LifeCam"; system('start "$LifeCamLoc"'); system('start LifeCam.exe');

      Maybe you want to read the documentation for the start command of cmd.exe?

      The start command takes at least two parameters, the title and the command to launch. So you will need to pass it two parameters from your script too.

      To get a feel for what the OS is going to see replace system with print then figure out if what you see is what you would type at the command line to get the effect you expect.

      True laziness is hard work