iniwrite funktioniert nicht

  • steh grad irgendwie aufm schlauch, kann mir mal bitte wer sagen warum des iniwrite hier net funktioniert?

    [autoit]


    checkpath()
    Func checkpath()
    $path = IniRead("test.ini", "path", "folder", "nothing set")
    If $path = "nothing set" Or $path = "" Then
    $path1 = FileOpenDialog("please set the path to your executable", @ProgramFilesDir, "executable (*.exe)", 1 + 2)
    If $path1 = "" Then
    MsgBox(16, "", "the script wont work without your test.exe dir!")
    Exit
    Else
    IniWrite("tt6.ini", "path", "folder", $path1)
    checkpath()
    EndIf
    EndIf
    EndFunc

    [/autoit]

    Einmal editiert, zuletzt von knx (23. Juli 2009 um 18:59)

  • Was funktioniert denn genau nicht? Habs grad mal getestet. Im Ordner der EXE Datei wird die Ini Datei einwandfrei erstellt.

  • Gib mal den Pfad zur c:\test.Ini komplett an, warum liest du in der einen und schreibst in eine andere?
    Ist das so gewollt? Warum bestückst Du $path nicht mi der Auswahl sondern nimmst eine neue Variable?
    Und warum rufst Du die Funktion in sich selber wieder auf, ist das so eine gute Idee,
    du prüfst ja die andere INI und die ist ja mitunter immer noch leer.

    Als exe evtl. ich habe eine dummy.au3 auf dem Desktop daneben wurde keine Datei erstellt.
    Mit Pfad zur Ini geht es auch mit der au3.
    So scheint es das zu machen was Du vorhast.

    [autoit]

    checkpath()
    Func checkpath()
    $path = IniRead("c:\test.ini", "path", "folder", "nothing set")
    If $path = "nothing set" Or $path = "" Then
    $path1 = FileOpenDialog("please set the path to your executable", @ProgramFilesDir, "(*.exe)", 1 + 2)
    If $path1 = "" Then
    MsgBox(16, "", "the script wont work without your test.exe dir!")
    Exit
    Else
    IniWrite("c:\test.ini", "path", "folder", $path1)
    checkpath()
    EndIf
    EndIf
    EndFunc

    [/autoit]

    Kannst ja auch mit @scriptdir & "\test.ini" arbeiten oder so.

    Achtung Anfänger! :whistling:

    Betrachten des Quellcodes auf eigene Gefahr, bei Übelkeit,Erbrechen,Kopfschmerzen übernehme ich keine Haftung. 8o

    Einmal editiert, zuletzt von Dietmar (23. Juli 2009 um 00:09)

  • so läufts wie es sein soll danke.

    [autoit]

    checkpath()
    Func checkpath()
    $path = IniRead(@ScriptDir & "\test.ini", "path", "folder", "nothing set")
    If $path = "nothing set" Or $path = "" Then
    $path = FileOpenDialog("please set the path to your executable", @ProgramFilesDir, "exe (*)", 1 + 2)
    If $path = "" Then
    MsgBox(16, "", "the bot wont work without your right guildwars dir!")
    Exit
    Else
    IniWrite(@ScriptDir & "\test.ini", "path", "folder", $path)
    checkpath()
    EndIf
    EndIf
    EndFunc

    [/autoit]