Perl 的 Win32::Spawn 使用方法

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/usr/bin/perl -w
use Win32;

#$ApplicationName = 'c:/winnt/system32/notepad.exe';
#$ApplicationName = "C:\\WINDOWS\\NOTEPAD.EXE";
$ApplicationName = 'c:\winnt\system32\notepad.exe';

#$CommandLine = "notepad";
$CommandLine = "notepad spawn.pl";


$status = Win32::Spawn( $ApplicationName,$CommandLine,$ProcessId );

if ( $status != 0 ) {
    print "Launched process with ID $ProcessId.\n";
} else {
    print "Failed to launch process.\n";
}