mirror of
https://github.com/curl/curl.git
synced 2026-07-26 05:47:16 +03:00
s2
This commit is contained in:
parent
7aa55663c3
commit
1ff63dde7d
10 changed files with 38 additions and 38 deletions
|
|
@ -136,7 +136,7 @@ sub pidexists {
|
|||
} else {
|
||||
my $filter = "PID eq $pid";
|
||||
# https://ss64.com/nt/tasklist.html
|
||||
my $result = `tasklist -fi \"$filter\" 2>$dev_null`;
|
||||
my $result = qx(tasklist -fi \"$filter\" 2>$dev_null);
|
||||
if(index($result, $pid) != -1) {
|
||||
return -$pid;
|
||||
}
|
||||
|
|
@ -170,12 +170,12 @@ sub pidterm {
|
|||
Win32::Process::KillProcess($pid, 0);
|
||||
} else {
|
||||
# https://ss64.com/nt/tasklist.html
|
||||
my $result = `tasklist -v -fo list -fi "PID eq $pid" 2>&1`;
|
||||
my $result = qx(tasklist -v -fo list -fi "PID eq $pid" 2>&1);
|
||||
$result =~ s/\r//g;
|
||||
$result =~ s/\n/ | /g;
|
||||
print "Task info for $pid before taskkill: '$result'\n";
|
||||
|
||||
$result = `powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine"`;
|
||||
$result = qx(powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine");
|
||||
$result =~ s/\r//g;
|
||||
print "Task child processes for $pid before taskkill:\n";
|
||||
print "$result\n";
|
||||
|
|
@ -221,12 +221,12 @@ sub pidkill {
|
|||
Win32::Process::KillProcess($pid, 0);
|
||||
} else {
|
||||
# https://ss64.com/nt/tasklist.html
|
||||
my $result = `tasklist -v -fo list -fi "PID eq $pid" 2>&1`;
|
||||
my $result = qx(tasklist -v -fo list -fi "PID eq $pid" 2>&1);
|
||||
$result =~ s/\r//g;
|
||||
$result =~ s/\n/ | /g;
|
||||
print "Task info for $pid before taskkill: '$result'\n";
|
||||
|
||||
$result = `powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine"`;
|
||||
$result = qx(powershell -Command "Get-CimInstance -ClassName Win32_Process -Filter 'ParentProcessId=$pid' | Select ProcessId,ParentProcessId,Name,CommandLine");
|
||||
$result =~ s/\r//g;
|
||||
print "Task child processes for $pid before taskkill:\n";
|
||||
print "$result\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue