To use Win32::Process::Create, one must supply the full path of the program to be
launched. It's obviously not good to hard code the path if that program may be
installed in different directories on different machines. I had to do the following,
for instance, to find the full path for SQL utility osql.exe:
my @path = grep(/sql/i, split(/;/, `path`));
my $app;
foreach my $path (@path) {
$app = "$path\\osql.exe";
last if (-f "\"$app\"");
}
Win32::Process::Create($process, $app, $osql, 1, $Win32::Process::CREATE_NEW_PROCESS,
".");
...
If the directory happens to be the first on the path, one also has to stripe off
'PATH='.
Is there a simpler way? There gotta be a simpler way. This is simply too ugly.
Linchi
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin