in reply to Windows + Win32::OLE + fork = Hell
On win32, system is far simpler to use than fork followed by exec. Eg:
my $pid = system 1, "/path/to/the/command.exe arg1 arg2";
Note: the first parameter '1', it causes the command to be run asynchronously, and the pid returned is a real pid.
This does have limitations. If your command involves shell characters, (io redirection etc.) then a cmd.exe session will be started and your command will be run within that which works fine except that the pid returned will be for cmd.exe and killing that will not kill the executable started from it.
|
|---|