Netzwerk Computer anzeigen und Dateien übertragen

  • Hallo AutoIT Team,
    ich habe folgendes Problem. Ich möchte ein Skript schreiben, mit dem ich die an meinem Rechner, mit LAN/W-LAN, angeschlossenen Computer anzeigen lassen und ein Datei z.B. lol.txt auf einen Netzwerk-Pc übertragen kann.
    Hab bis jetzt weder in der AutoIT-Hilfe, noch hier im Forum was brauchbares gefunden.
    Wäre echt super wenn ihr mir helfen könntet. :thumbup:
    mfg
    bepelz ^^

    Einmal editiert, zuletzt von Bepelz (13. April 2011 um 20:48)

  • Hi,
    ich habe was im Englischen AutoIt Forum gefunden um die PC's im Netzwerk aufzulisten.

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    ;http://www.autoitscript.com/forum/topic/91…post__p__655253
    Global Const $SV_TYPE_WORKSTATION = 0x1
    Global Const $SV_TYPE_SERVER = 0x2
    Global Const $SV_TYPE_SQLSERVER = 0x4
    Global Const $SV_TYPE_DOMAIN_CTRL = 0x8
    Global Const $SV_TYPE_DOMAIN_BAKCTRL = 0x10
    Global Const $SV_TYPE_TIME_SOURCE = 0x20
    Global Const $SV_TYPE_AFP = 0x40
    Global Const $SV_TYPE_NOVELL = 0x80
    Global Const $SV_TYPE_DOMAIN_MEMBER = 0x100
    Global Const $SV_TYPE_PRINTQ_SERVER = 0x200
    Global Const $SV_TYPE_DIALIN_SERVER = 0x400
    Global Const $SV_TYPE_XENIX_SERVER = 0x800
    Global Const $SV_TYPE_NT = 0x1000
    Global Const $SV_TYPE_WFW = 0x2000
    Global Const $SV_TYPE_SERVER_MFPN = 0x4000
    Global Const $SV_TYPE_SERVER_NT = 0x8000
    Global Const $SV_TYPE_POTENTIAL_BROWSER = 0x10000
    Global Const $SV_TYPE_BACKUP_BROWSER = 0x20000
    Global Const $SV_TYPE_MASTER_BROWSER = 0x40000
    Global Const $SV_TYPE_DOMAIN_MASTER = 0x80000
    Global Const $SV_TYPE_WINDOWS = 0x400000
    Global Const $SV_TYPE_CLUSTER_NT = 0x1000000
    Global Const $SV_TYPE_TERMINALSERVER = 0x2000000
    Global Const $SV_TYPE_CLUSTER_VS_NT = 0x4000000
    Global Const $SV_TYPE_LOCAL_LIST_ONLY = 0x40000000
    Global Const $SV_TYPE_DOMAIN_ENUM = 0x80000000
    Global Const $SV_TYPE_ALL = 0xFFFFFFFF

    [/autoit] [autoit][/autoit] [autoit]

    $aCompList = _NetServerEnum($SV_TYPE_WORKSTATION)

    [/autoit] [autoit][/autoit] [autoit]

    _ArrayDisplay($aCompList)

    [/autoit] [autoit][/autoit] [autoit]

    Func _NetServerEnum ($iSrvType = -1, $sDomain = '')
    Local $uBufPtr = DllStructCreate("ptr;int;int"), $res[1]=[0], $i
    Local $uRecord = DllStructCreate("dword;ptr"), $iRecLen = DllStructGetSize($uRecord)
    Local $uString = DllStructCreate("char[16]")
    Local $uDomain = DllStructCreate("byte[32]"), $pDomain = 0
    If Not ($sDomain='' Or $sDomain='*') Then
    DllStructSetData($uDomain, 1, StringToBinary($sDomain,2))
    $pDomain = DllStructGetPtr($uDomain)
    EndIf
    Local $ret = DllCall ("netapi32.dll", "int", "NetServerEnum", _
    "ptr", 0, "int", 100, _
    "ptr", DllStructGetPtr($uBufPtr,1), "int", -1, _
    "ptr", DllStructGetPtr($uBufPtr,2), _
    "ptr", DllStructGetPtr($uBufPtr,3), _
    "int", $iSrvType, "ptr", $pDomain, "int", 0 )
    If $ret[0] Then Return SetError(1, $ret[0], '')
    Local $res[DllStructGetData($uBufPtr,3)+1]=[DllStructGetData($uBufPtr,3)]
    For $i=1 To DllStructGetData($uBufPtr,3)
    Local $uRecord = DllStructCreate("dword;ptr", DllStructGetData($uBufPtr,1)+($i-1)*$iRecLen)
    Local $sNBName = DllStructCreate("byte[32]", DllStructGetData($uRecord,2))
    DllStructSetData($uString,1,BinaryToString(DllStructGetData($sNBName,1),2))
    $res[$i] = DllStructGetData($uString,1)
    Next
    $ret = DllCall ("netapi32.dll", "int", "NetApiBufferFree", "ptr", DllStructGetData($uBufPtr,1))
    Return $res
    EndFunc

    [/autoit]
  • So es funktioniert wie ich es wollte Danke noch mal :thumbup:
    Kann ich jetzt Dateien mit DriveMapAdd() auf die Gefundenen Pc's rüber kopieren???

  • ich glaub das kannst du dir selbst beantworten oder? :D
    also wenn du nicht darfst dann darfst du halt nicht.....