Leser: 19
1
2
3
4
5
6
7
8
9
10
sub doCmd {
open (CMD,"cscript.exe c:\\windows\\system32\\Printing_Admin_Scripts\\de-DE\\$_[0].vbs $_[1]|");
my $ret;
my @data;
while (<CMD>) {
push @data,$_;
$ret = $1 if $_ =~ /Return Value \= (\d+) /;
}
return ($ret,@data);
}
open (runas /user:Domäne\Benutzer CMD,"cscript.exe c:\\windows\\system32\\Printing_Admin_Scripts\\de-DE\\$_[0].vbs $_[1]|");
1 2 3 4
my $cmd_line = sprintf(qq~runas /user:%s\\%s cscript.exe "c:\\windows\\system32\\Printing_Admin_Scripts\\de-DE\\%s.vbs" "%s"|~, $ENV{USERDOMAIN}, $ENV{USERNAME}, @_); open (CMD, $cmd_line) or die "Unable to open external program: $!"; # ...