Beispiel:
- Dein Client heißt '\\client'
- Du willst auf diesem Client mit dem Programm 'kill.exe' den Prozess 'notepad.exe' abschießen. kill.exe liegt im %PATH% und kann Prozesse nach Namen verarbeiten
- Auf Deinem Server liegt C:\pfad\psexec.exe
Perl-Zeile:
system("C:\\pfad\\psexec \\\\client kill notepad.exe");
für mehrere clients:
my @clients = qw( client1 client2 client3 ); # Namen ohne '\\'
foreach my $client ( @clients ) {
system("C:\\pfad\\psexec \\\\$client kill notepad.exe");
}
mehrere Prozesse auf mehreren clients, sollte zumindest mit MS kill funktionieren:
my @clients = qw( client1 client2 client3 ); # Namen ohne '\\'
my $procs = "notepad.exe calc.exe test.exe";
foreach my $client ( @clients ) {
system("C:\\pfad\\psexec \\\\$client kill $procs");
}
Nach wie vor ist nicht so ganz klar, wo es bei Dir klemmt ?!\n\n
<!--EDIT|FIFO|1143487367-->
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"