sub doCmd { open (CMD,"cscript.exe c:\\windows\\system32\\Printing_Admin_Scripts\\de-DE\\$_[0].vbs $_[1]|"); my $ret; my @data; while () { push @data,$_; $ret = $1 if $_ =~ /Return Value \= (\d+) /; } return ($ret,@data); }