|< 1 2 3 >| | 21 Einträge, 3 Seiten |
system "start notepad $datei";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Win32::Process;
use Win32;
sub ErrorReport{
print Win32::FormatMessage( Win32::GetLastError() );
}
Win32::Process::Create($ProcessObj,
"C:\\winnt\\system32\\notepad.exe",
"notepad temp.txt",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
$ProcessObj->Suspend();
$ProcessObj->Resume();
$ProcessObj->Wait(INFINITE);
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";
}
|< 1 2 3 >| | 21 Einträge, 3 Seiten |