in reply to WIN32 exec mystery
Weirdness.
Here's some code that works, using Win32::Process. (Note: I made a copy of notepad.exe in my "Program Files" directory to test spaces.)
$prgArgs is (obviously) the arguments that get passed into the program. By convention, the first argument is always the executable name. notepad.exe doesn't seem to care if you pass itself in as the first argument or not, but some other programs do...use Win32::Process; my $prgPath = 'c:/program files/notepad.exe'; my $prgArgs = 'notepad.exe'; Win32::Process::Create( $processObj, $prgPath, $prgArgs, 0, NORMAL_PRIORITY_CLASS, ".") || die Win32::FormatMessage(Win32::Get +LastError());
Hope this helps.
-Ton
-----
Be bloody, bold, and resolute; laugh to scorn
The power of man...
|
---|
Replies are listed 'Best First'. | |
---|---|
All is good
by major tom (Novice) on Jul 02, 2002 at 23:53 UTC | |
by major tom (Novice) on Jul 04, 2002 at 23:05 UTC |
In Section
Seekers of Perl Wisdom