Hallo Forum,
ich versuche ein bestehendes Perl-Programm zu warten (hmm, komme eigentlich aus der C#-Ecke..).
Das Programm erzeugt eine Menge Links zu anderen Programmen - meistens sind das DOS-Batchdateien. Soweit so gut. Jeder dieser Links soll unter Windows mit den Admin-Rechten ausgeführt werden. "Zu Fuß" klickt man auf den Link, Optionen, Ausführen als Admin. Wie mache ich das aber im Skript?
Viele Dank für Eure Hilfe.
P.
Der Code (ich hoffe, ich erwische den richtigen Abschnitt..)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
sub windows_create_shortcut
{
my $file=shift;
my $path=shift;
my $args=shift;
debug(2, "entering windows_create_shortcut\n");
my $link = Win32::Shortcut->new();
if (lc(substr($file, length($file)-4)) ne ".lnk" ) {
$file .= ".lnk";
}
debug(3, "creating shortcut '$file' to '$path' '$args'\n");
$link->{'File'} = $file;
$link->{'Path'} = $path;
$link->{'Arguments'} = $args;
$link->{'ShowCmd'} = 1;
$link->Save;
$link->Close;
debug(2, "leaving windows_create_shortcut\n");
}
und....
windows_create_shortcut(
$desktop."\\$sid\\c taf (tail -f $alert_file_name)",
$dbaconf->{SID}->{$sid}->{'DBA_COMMON'}."\\scripts\\dosbox",
"$sid taf");
windows_create_shortcut(
$desktop."\\$sid\\c ta200 (tail -200 $alert_file_name)",
$dbaconf->{SID}->{$sid}->{'DBA_COMMON'}."\\scripts\\dosbox",
"$sid ta200");
windows_create_shortcut(
$desktop."\\$sid\\c via (notepad $alert_file_name)",
$dbaconf->{SID}->{$sid}->{'DBA_COMMON'}."\\scripts\\dosbox",
"$sid via");
windows_create_shortcut(
$desktop."\\$sid\\c vio (notepad init$sid.ora)",
"notepad",
$dbaconf->{SID}->{$sid}->{'DBA_ENTITY'}."\\pfile\\init$sid.ora");
windows_create_shortcut(
$desktop."\\$sid\\c dosbox (DOS_box with environment)",
$dbaconf->{SID}->{$sid}->{'DBA_COMMON'}."\\scripts\\dosbox",
"$sid cmd");
modedit Editiert von pq: code-tags hinzugefügt
Last edited: 2012-03-05 23:43:00 +0100 (CET)