You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
504 B
Perl

# This function takes the error number returned by the Win32::GetLastError function.
#!/usr/bin/perl -w
use Win32;
$ApplicationName = 'c:\winnt\system32\notepad.exe';
$CommandLine = "notepad";
# Spawn the process.
$status = Win32::Spawn( $ApplicationName,$CommandLine,$ProcessId );
if ( $status != 0 ) {
print "Launched process with ID $ProcessId.\n";
} else {
print "Failed to launch process.\n";
print Win32::FormatMessage( Win32::GetLastError() );
}