Thread VB Script --> Perl Code (9 answers)
Opened by renee at 2005-08-10 12:58

zipster
 2005-08-10 12:49
#10388 #10388
User since
2004-09-06
458 Artikel
BenutzerIn
[default_avatar]
Hi,

kann mir jemand helfen den folgenden VB CODE für Perl zukonvertieren?
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
set objSWbemServices = GetObject("winmgmts:\\.\root\wmi")
set colInstances = objSwbemServices.ExecQuery("SELECT * FROM MSNDis_80211_BSSIList")
for each obj in colInstances
if left(obj.InstanceName, 4) <> "WAN " and right(obj.InstanceName, 8) <> "Miniport" then
for each rawssid in obj.Ndis80211BSSIList
ssid = ""
for i=0 to ubound(rawssid.Ndis80211SSid)
decval = rawssid.Ndis80211Ssid(i)
if (decval > 31 AND decval < 127) then
ssid = ssid & Chr(decval)
end if
next
wscript.echo ssid
next
end if
next


Ich habe mich selbst schon daran versucht, aber ab Zeile 5 weiß ich nicht mehr weiter.

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
use strict;
use Win32::OLE('in');

use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;

my @computers = ("localhost");
my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\WMI") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM MSNdis_80211_BSSIList");

foreach my $objItem (in $colItems) {


Gruß Zipster\n\n

<!--EDIT|zipster|1123664088-->

View full thread VB Script --> Perl Code