Hallo Zusammen,
ich hab hier einen script, der das automatische einfügen von Wlan keys ermöglicht.
dies funktioniert auch soweit bestens.
allerdings würde ich dieses script "genau" kennen. in der schule musste ich immer am anfang einer programmiersprache jede zeile kommentieren was die bedeutet bzw macht.
das würde ich hier auch gerne machen. allerdings bin ich auf dem gebiet noch etwas .. lassen wir das etwas weg .. UNERFAHREN.
ich weiss das es mühsam ist .. würde mich aber trotzdem freuen wenn mir einer dies kommenteiren könnte.
Spoiler anzeigen
;*******************************************************************************
;variables
;*******************************************************************************
;parameters file
Local $iniFile = "autowep.ini"
;wireless parameters
Local $WlanSSID = ""
Local $Wlankey = ""
Local $UseWPA = ""
;wizard window title control
Local $xpsp2resLib = 0
Local $resource[4]
Local $wwName = ""
;System stuff
Local $wizPID
Local $handle
;*******************************************************************************
;GET the Wireless parameters
;*******************************************************************************
If $CmdLine[0]<2 Then
If $CmdLine[0] = 1 Then $iniFile = $CmdLine[1]
If Not FileExists($iniFile) Then
;MsgBox(0,"Fehler","Ungültige Pfadangabe, Ini-Datei konnte nicht gefunden werden!")
Exit
EndIf
$WlanSSID = IniRead($iniFile, "Wlan", "WlanSSID", "")
$Wlankey = IniRead($iniFile, "Wlan", "Wlankey", "")
$UseWPA = IniRead($iniFile, "Wlan", "UseWPA", "")
Else
$WlanSSID = $CmdLine[1]
$Wlankey = $CmdLine[2]
If $CmdLine[0]>2 Then $UseWPA = $CmdLine[3]
EndIf
If @error Or Not ($WlanSSID And $Wlankey) Then Exit
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If $UseWPA <> "yes" And $UseWPA <> "WPA" Then $UseWPA = ""
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit];*******************************************************************************
;GET the name of the "Wireless Network setup Wizard"
;*******************************************************************************
$xpsp2resLib = DllCall("KERNEL32.dll", "long", "LoadLibrary", "str", "xpsp2res.dll")
If $xpsp2resLib = 0 Then Exit
If Not @error Then
$resource = DllCall("user32.dll", "long", "LoadString", "long", $xpsp2resLib[0], "long", 16201, "str", "", "long", 256)
$wwName = $resource[3]
EndIf
;*******************************************************************************
;RUN the "Wireless Network setup Wizard", or whatever its exact name is
;*******************************************************************************
$wizPID = Run("rundll32.exe shell32.dll,Control_RunDLL NetSetup.cpl,@0,WNSW", "") ;, @SW_MAXIMIZE)
If Not $wizPID Then Exit
If $wwName Then
Opt("WinTitleMatchMode", 1)
WinWait($wwName, $wwName, 5)
$handle = WinGetHandle($wwName);, $wwName)
Else
Opt("WinTitleMatchMode", 4)
WinWait("classname=#32770", "", 5)
$handle = WinGetHandle("classname=#32770", "")
EndIf
If @error Then
MsgBox(1, "Error", "Der Fehler " & @error & " ist aufgetreten" )
ProcessClose ( $wizPID )
WinClose($handle)
Exit
EndIf
;*******************************************************************************
;FILL in the wizard pages
;*******************************************************************************
If Not WinActive($handle) Then WinActivate($handle)
WinWaitActive($handle)
ControlClick($handle, "", 12324)
[/autoit] [autoit][/autoit] [autoit]While Not (ControlCommand($handle, "", 7423, "IsVisible", "") And _
ControlCommand($handle, "", 7422, "IsVisible", "") And _
ControlCommand($handle, "", 7424, "IsVisible", ""))
WinActivate($handle)
If ControlCommand($handle, "", 7416, "IsVisible", "") Then
ControlClick($handle, "", 7416)
ControlClick($handle, "", 12324)
EndIf
WEnd
ControlSetText($handle, "", 7423, $WlanSSID)
ControlClick($handle, "", 7422)
If $UseWPA Then ControlClick($handle, "", 7424)
ControlClick($handle, "", 12324)
While Not (ControlCommand($handle, "", 7434, "IsVisible", "") And _
ControlCommand($handle, "", 2007, "IsVisible", "") And _
ControlCommand($handle, "", 2012, "IsVisible", ""))
WinActivate($handle)
WEnd
ControlClick($handle, "", 7434)
ControlSetText($handle, "", 2007, $Wlankey)
ControlSetText($handle, "", 2012, $Wlankey)
ControlClick($handle, "", 12324)
;page 4
While Not ControlCommand($handle, "", 7442, "IsVisible", "")
WinActivate($handle)
WEnd
ControlClick($handle, "", 7442)
ControlClick($handle, "", 12324)
;final page
While Not ControlCommand($handle, "", 12325, "IsVisible", "")
WinActivate($handle)
WEnd
ControlClick($handle, "", 12325)
Exit
[/autoit]Edit BugFix: Tags gesetzt
Auch wenn es ein Skript ist, du bittest um Hilfe - deshalb: Verschoben