in reply to Starting a process under Win32

The problem is that the documentation is not clear, partly because of the way Microsoft document the underlying API CreateProcess. The 3rd argument must be the complete command-line, including the program name:
my $program = 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe', Win32::Process::Create( $p, $program, "$program --rc-host 127.0.0.1:9999", 0, NORMAL_PRIORITY_CLASS, '.' ) or die;
Note that the full path-name must be included.

Replies are listed 'Best First'.
Re^2: Starting a process under Win32
by Anonymous Monk on Feb 18, 2008 at 16:09 UTC
    Seems clear to me
    SYNOPSIS use Win32::Process; use Win32; sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } Win32::Process::Create($ProcessObj, "C:\\winnt\\system32\\notepad.exe", "notepad temp.txt", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); $ProcessObj->Suspend(); $ProcessObj->Resume(); $ProcessObj->Wait(INFINITE);
Re^2: Starting a process under Win32
by runrig (Abbot) on Feb 19, 2008 at 23:26 UTC
    The program name needs to have the full path in the 2nd argument, but not the 3rd.
Re^2: Starting a process under Win32
by JStrom (Pilgrim) on Feb 19, 2008 at 02:14 UTC
    I've changed it to
    Win32::Process::Create( $p, "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe", "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe --r +c-host 127.0.0.1:9999", 0, NORMAL_PRIORITY_CLASS, '.' ) or die $! . $^E;
    Still the same problem, VLC reports the command line is no good.
      OK. What is the exact text of the error message?
        The command line options couldn't be loaded, check that they are valid +. Press the RETURN key to continue...
        This error is coming from VLC, the perl script reports no error at the Create() call.