in reply to Starting up an external program with Win32::Process::Create fails for some, no others?
My Create mantra is a little different to yours. The MSDN documentation is a little confusing regarding the use of the application name and command line parameters used by CreateProcess (which is what Create uses under the hood). I pass the full absolute path including the executable name as the "application name" parameter and I pass what you would likely type on the command line for the command line parameter (generally the executable name sans extension followed by command line parameters). So something like:
use strict; use warnings; use Win32::Process qw(); my $app = "$ENV{SystemRoot}\\Notepad.exe"; my $cmd = 'Notepad "my file.txt"'; my $proc; my $flags = Win32::Process::NORMAL_PRIORITY_CLASS(); my $startDir = 'c:\\tmp'; Win32::Process::Create($proc, $app, $cmd, 0, $flags, $startDir);
It may be that providing the full command line for the application name is causing grief in some cases?
|
|---|