#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Simon's Systeminformationstool", 591, 260, 192, 124)
$Label1 = GUICtrlCreateLabel("Systeminformationen auslesen", 16, 80, 146, 17)
$Button1 = GUICtrlCreateButton("Starten", 168, 80, 235, 17, $WS_GROUP)
$Label2 = GUICtrlCreateLabel("Registry öffnen", 16, 8, 75, 17)
$Button2 = GUICtrlCreateButton("Öffnen", 168, 8, 235, 17, $WS_GROUP)
$Label3 = GUICtrlCreateLabel("CCleaner starten", 16, 104, 82, 17)
$Button3 = GUICtrlCreateButton("Starten", 168, 104, 235, 17, $WS_GROUP)
$Label4 = GUICtrlCreateLabel("Systemstart öfffnen", 16, 32, 94, 17)
$Button4 = GUICtrlCreateButton("Öffnen", 168, 32, 235, 17, $WS_GROUP)
$Label5 = GUICtrlCreateLabel("Taskmanager öffnen", 16, 56, 102, 17)
$Button5 = GUICtrlCreateButton("Öffnen", 168, 56, 235, 17, $WS_GROUP)
$Label6 = GUICtrlCreateLabel("Programme deinstallieren", 16, 128, 121, 17)
$Button6 = GUICtrlCreateButton("Deinstallieren", 168, 128, 235, 17, $WS_GROUP)
$Label7 = GUICtrlCreateLabel("TCP/UDP Verbindungen", 16, 152, 140, 17)
$Button7 = GUICtrlCreateButton("Anzeigen", 168, 152, 235, 17, $WS_GROUP)
$Label8 = GUICtrlCreateLabel("Malwarebytes ausführen", 16, 176, 119, 17)
$Button8 = GUICtrlCreateButton("Ausführen", 168, 176, 235, 17, $WS_GROUP)
$Label9 = GUICtrlCreateLabel("Simon's Systeminformations Tool", 424, 16, 157, 17)
$Label10 = GUICtrlCreateLabel("Defragmentieren", 16, 200, 82, 17)
$Button9 = GUICtrlCreateButton("Defragmentieren", 168, 200, 235, 17, $WS_GROUP)
$Label11 = GUICtrlCreateLabel("Router Adressen", 16, 224, 83, 17)
$Button10 = GUICtrlCreateButton("Router Adressen öffnen", 168, 224, 235, 17, $WS_GROUP)
$Label12 = GUICtrlCreateLabel("", 424, 40, 69, 17)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			_SysInfo()
		Case $Button2
			_Registry()
		Case $Button3
			_CCleaner()
		Case $Button4
			_SysStart()
		Case $Button5
			_Task()
		Case $Button6
			_Uninstall()
		Case $Button7
			_Connection()
		Case $Button8
			_mbam()
		Case $Button9
			_Defrag()
		Case $Button10
			_Router()
	EndSwitch
WEnd

Func _SysInfo()
	$i = 0
	Local $rueckgabe
	$File = FileOpen(@ComputerName & ".txt", 1)
	$pid = Run(@ComSpec & " /k systeminfo", @ScriptDir, @SW_HIDE, 6)
	While 1
		$rueckgabe &= StdoutRead($pid)
		If @error Then
			GUICtrlSetData($Label12, "")
			ExitLoop
		EndIf
		If $i = 1 Then
			GUICtrlSetData($Label12, "Bitte warten.")
			Sleep(500)
			$i += 1
		ElseIf $i = 2 Then
			GUICtrlSetData($Label12, "Bitte warten..")
			Sleep(500)
			$i += 1
		ElseIf $i = 3 Then
			GUICtrlSetData($Label12, "Bitte warten...")
			Sleep(500)
			$i = 0
		Else
			GUICtrlSetData($Label12, "Bitte warten")
			Sleep(500)
			$i += 1
		EndIf
	WEnd
	FileWrite($File, $rueckgabe)
	FileClose($File)
	ShellExecute(@ComputerName & ".txt", "", @ScriptDir, "edit")
EndFunc   ;==>_SysInfo
Func _Registry()
	ShellExecute("regedit")
EndFunc   ;==>_Registry
Func _SysStart()
	ShellExecute("msconfig")
EndFunc   ;==>_SysStart
Func _Task()
	ShellExecute("taskmgr")
EndFunc   ;==>_Task
Func _Uninstall()
	Run('rundll32 shell32.dll,Control_RunDLL appwiz.cpl')
EndFunc   ;==>_Uninstall
Func _Connection()
	Run(@ScriptDir & "\Extras\ConnView\ConnView.exe")
EndFunc   ;==>_Connection
Func _Defrag()
	ShellExecute("dfrgui")
EndFunc   ;==>_Defrag
Func _Router()
	$Router = InputBox("Router Adresse", "Hersteller: ")
	Switch $Router
		Case "Fritzbox"
			MsgBox(0, "Adressen/Fritzbox", "AVM FRITZ!Box	192.168.178.1" & @CRLF & "AVM FRITZ!Box	169.254.1.1" & @CRLF & "AVM FRITZ!Box	192.168.178.254" & @CRLF & "FRITZ!Box	192.168.178.1" & @CRLF & "FRITZ!Box	169.254.1.1" & @CRLF & "FRITZ!Box	192.168.178.254" & @CRLF & "Frtitz!Box	fritz.box")
		Case "D-Link"
			MsgBox(0, "Adressen/D-Link", "D-Link	192.168.0.1" & @CRLF & "D-Link	192.168.1.1" & @CRLF & "D-Link	192.168.0.50")
		Case "Devolo"
			MsgBox(0, "Adressen/Devolo", "Devolo	192.168.0.253")
		Case "Netgear"
			MsgBox(0, "Adressen/Netgear", "Netgear	192.168.0.1" & @CRLF & "Netgear	192.168.1.1")
		Case "Speedport"
			MsgBox(0, "Adressen/Speedport", "Speedport	192.168.2.1" & @CRLF & "Speedport	speedport.ip")
		Case "all"
			MsgBox(0, "Adressen/Fritzbox", "AVM FRITZ!Box	192.168.178.1" & @CRLF & "AVM FRITZ!Box	169.254.1.1" & @CRLF & "AVM FRITZ!Box	192.168.178.254" & @CRLF & "FRITZ!Box	192.168.178.1" & @CRLF & "FRITZ!Box	169.254.1.1" & @CRLF & "FRITZ!Box	192.168.178.254" & @CRLF & "Frtitz!Box	fritz.box")
			MsgBox(0, "Adressen/D-Link", "D-Link	192.168.0.1" & @CRLF & "D-Link	192.168.1.1" & @CRLF & "D-Link	192.168.0.50")
			MsgBox(0, "Adressen/Devolo", "Devolo	192.168.0.253")
			MsgBox(0, "Adressen/Netgear", "Netgear	192.168.0.1" & @CRLF & "Netgear	192.168.1.1")
			MsgBox(0, "Adressen/Speedport", "Speedport	192.168.2.1" & @CRLF & "Speedport	speedport.ip")
	EndSwitch
EndFunc   ;==>_Router
Func _CCleaner()
	If @CPUArch = "X86" Then
		Run(@ScriptDir & "\Extras\CCleaner\CCleaner.exe")
	Else
		Run(@ScriptDir & "\Extras\CCleaner\CCleaner64.exe")
	EndIf
EndFunc   ;==>_CCleaner
Func _mbam()
	Run(@ScriptDir & "\Extras\MBAM\mbam-setup-1.50.1.1100.exe")
EndFunc   ;==>_mbam
