Hey bei diesem Script funktioniert das auslesen nicht. ( Es wird nichts in der MsgBox angezeigt!)
Ebenfalls klappt dsa BackUp erstellen nicht?
#include <GUIConstants.au3>
AdlibEnable("_Checkbox", 100)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate(".au3 Kommentar Remover", 358, 84, 193, 125)
$input1 = GUICtrlCreateInput("", 70, 0, 263, 21)
$Button1 = GUICtrlCreateButton("...", 334, 0, 23, 21, 0)
$Label1 = GUICtrlCreateLabel("Autoit Datei", 8, 6, 59, 17)
$input2 = GUICtrlCreateInput("", 70, 30, 263, 21)
$Button2 = GUICtrlCreateButton("...", 334, 30, 23, 21, 0)
$Label2 = GUICtrlCreateLabel("Speicherpfad", 0, 38, 67, 17)
$Checkbox1 = GUICtrlCreateCheckbox("BackUp erstellen", 0, 66, 97, 17)
$Button3 = GUICtrlCreateButton("Build", 282, 62, 75, 21, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Func _Checkbox()
If GUICtrlRead($Checkbox1) = 4 Then
GUICtrlSetState($input2, $GUI_DISABLE)
GUICtrlSetState($Button2, $GUI_DISABLE)
Else
GUICtrlSetState($input2, $GUI_ENABLE)
GUICtrlSetState($Button2, $GUI_ENABLE)
EndIf
EndFunc ;==>_Checkbox
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$datei = FileOpenDialog("Datei Auswahl", @ScriptDir, "Autoit (*.au3)")
GUICtrlSetData($input1, $datei)
Case $Button2
$datei2 = FileSelectFolder("Speicherpfad wählen", "")
GUICtrlSetData($input2, $datei2)
Case $Button3
$file = FileOpen($datei, 2)
$text1 = FileRead($file)
$text = StringRegExpReplace($text1, ';.*', '')
If GUICtrlRead($Checkbox1) = 1 Then
FileWrite(GUICtrlRead($input2) & FileGetLongName($file) & "_old",1)
EndIf
FileWrite($file, $text)
FileClose($file)
If Not @error Then
MsgBox(0, "", $text)
EndIf
EndSwitch
WEnd