Thread Notepad öffnet sich nicht vom Browser aus: Von der Konsole klappts (20 answers)
Opened by juergen at 2005-01-20 15:31

Strat
 2005-01-20 20:38
#4154 #4154
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
ein script kann man unter windows z.B. folgendermaszen starten
Code: (dl )
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
#! /usr/bin/perl
use warnings;
use strict;
use Win32::OLE;
use Win32::OLE::Variant;

my $server = shift(@ARGV) || '.';
$server =~ s|^[\\/]+||;

my $class = "WinMgmts:{impersonationLevel=impersonate}!//$server";
my $wmi = Win32::OLE->GetObject($class) or
die "Error: Couldn't connect to \\\\$server: " . Win32::OLE->LastError();

# get a Win32_Process class object
my $process = $wmi->Get("Win32_Process") or
die "Error: couldn't get the process list: " . Win32::OLE->LastError();

# create a BYREF variant so a COM object can modify its value and return it
my $pid = Variant(VT_I4 | VT_BYREF, 0);
if (0 == $process->Create(join(" ", @ARGV), undef, undef, $pid)) {
print "Process created with PID $pid\n";
} # if
else {
print "Error: couldn't create process.\n";
}
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/

View full thread Notepad öffnet sich nicht vom Browser aus: Von der Konsole klappts