Leser: 2
![]() |
|< 1 2 >| | ![]() |
17 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl
use Win32;
use Win32::Process::Info;
my $exe = "notepad.exe"; # Name der Processdatei
my $pi = Win32::Process::Info->new();
check_process();
print $returncode;
#while ($returncode eq "running")
# { check_process();
# print $returncode;
# }
sub check_process {
foreach my $hashref ($pi->GetProcInfo())
{
if (lc($hashref->{Name}) eq $exe)
{
#print "Process: $hashref->{Name}\n";
$returncode = "running";
}
}
if ($returncode eq "running") { return $returncode; }
else {
$returncode="not running";
return $returncode;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w
#
use strict;
use Win32::Process;
use Win32::Process::Info;
my $run = 1;
while ($run) {
my $pi = Win32::Process::Info->new();
my @info = $pi->GetProcInfo();
my $run = 0;
for my$av (0..$#info) {
if ($info[$av]{Name} =~ /notepad.exe/) {
$run = 1;
}
}
}
#...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w
#
use strict;
use Win32::Process;
use Win32::Process::Info;
my $run = 1;
while ($run) {
my $pi = Win32::Process::Info->new();
my @info = $pi->GetProcInfo();
my $run = 0;
for my$av (0..$#info) {
if ($info[$av]{Name} =~ /notepad.exe/) {
$run = 1;
}
}
}
#...
if ($info[$av]{Name} =~ /notepad.exe/)
my $run = 0;
![]() |
|< 1 2 >| | ![]() |
17 Einträge, 2 Seiten |