Jump to content

Recommended Posts

Posted

This worked on my machine to get the name of the only computer on my network:

$strComputer = "."
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
For $obj In $colItems
    MsgBox(0,"",$obj.Caption)
Next

Das Häschen benutzt Radar

Posted

or

#include<GuiListView.au3>
#include<GUIConstants.au3>
GUICreate("NetView in ListView", 520, 550, 100, 100, -1)
GUISetBkColor(0x00E0FFFF) ; will change background color

$listview = GUICtrlCreateListView("Rechnername|Kommentar", 10, 10, 400, 450, Default, $LVS_EX_GRIDLINES)
_GUICtrlListView_SetColumnWidth($listview, 1, $LVSCW_AUTOSIZE_USEHEADER)

Global $s_Comments[1]
Global $s_Servernames = Net_View()

For $i = 0 To UBound($s_Servernames) - 1
    GUICtrlCreateListViewItem($s_Servernames[$i] & '|' & $s_Comments[$i], $listview)
Next
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit (0)
    EndSwitch
WEnd

Func Net_View()
    Local $s_Buf = ''
    Local $a_Buf = ''
    Local $i_Pid = Run(@ComSpec & ' /c net view', '', @SW_HIDE, 2 + 4)
    While Not @error
        $s_Buf &= StdoutRead($i_Pid)
    WEnd
    Local $netView_Lines = StringSplit($s_Buf, @LF)
    ReDim $s_Comments[UBound($netView_Lines) ]
    For $i = 4 To UBound($netView_Lines) - 1
        $s_Comments[$i - 4] = StringMid($netView_Lines[$i], 24, 30)
    Next
    $a_Buf = StringRegExp($s_Buf, "\\\\([0-9a-zA-Z-]*)", 3)
    ProcessClose($i_Pid)
    Return $a_Buf
EndFunc  ;==>Net_View

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

excellent, Mega !

can you please add ip adresses to the list ?

thx

j.

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...