#!C:/Perl/bin
use warnings;
use strict;
# #801473
my $temp = 'F:\fake.htm';
chdir ('C:/Program Files/rest/of/path'); # to program.exe
system("program.exe $temp");
This will work, of course, only for programs that actually run in the cmd window; if you want to run a W32 program, you'll want to revise your SOPW.
Update:
| [reply] [d/l] |
starts a command prompt .exe
It depends on what you mean by that. ww assumed you meant a console program, but maybe you do mean a command prompt, like cmd.exe. The trick is the cmd.exe 'start' command, which creates a new console window, otherwise it will use the parent window. This is based on one I use: use warnings;
use strict ;
my $temp = '"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bi
+n\vcvars32.bat"';
my $cmd = "start $ENV{comspec} /k $temp";
if (system ($cmd)) {
warn 'command failed with '.$? >> 8;
}
| [reply] [d/l] |