<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Salve a tutti, volevo sapere qual'è la vià più
breve per ottenere in python un prg che giri più o meno come questo
vbs...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>main()<BR>Sub main()<BR>Set fso =
CreateObject("Scripting.FileSystemObject")<BR>Set wscr =
CreateObject("Wscript.Shell")<BR>Dim GlobalName<BR>Dim MyDomain<BR>Set
GlobalName = GetObject("WinNT://WORKGROUP")<BR>Set lg =
fso.CreateTextFile("c:\log.txt", True)<BR>For Each MyDomain in
GlobalName<BR>wmiQuery = "Select * From Win32_PingStatus Where Address =
'MyDomain.Name'" <BR> Set objWMIService =
GetObject("winmgmts:\\.\root\cimv2") <BR>Set objPing =
objWMIService.ExecQuery(wmiQuery) <BR>For Each objStatus In objPing <BR>If
objStatus.StatusCode = 0 Then <BR>lg.Write MyDomain.Name & "---> " &
objStatus.ProtocolAddress &vbCrLf<BR>Else<BR>Exit Sub<BR>End If
<BR>Next<BR>Next<BR>End Sub<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>grazie in anticipo a
tutti</DIV></FONT></BODY></HTML>