Pass trough a registry key to search the mssql install path ?
Yves.
-----Message d'origine-----
De: Shea, Linchi [mailto:[EMAIL PROTECTED]]
Date: jeudi 15 mars 2001 23:45
À: Perl-Win32-Admin@Listserv. Activestate. Com (E-mail)
Objet: Path of an EXE file
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
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin