.exe ausführen mit geladener Datei

  • Ich möchte gerne eine Datei laden und diese mit einer .exe Datei ausführen lassen. Der Syntax der .exe muss so aussehen:

    Spoiler anzeigen


    _unaps.exe OUTPUTFILE.aps INPUTFILE.aps

    Ich habe Probleme mit dem $String2. Dort soll der Name der geladenen Datei stehen.

    Spoiler anzeigen
    [autoit]


    Case $UnApsbutton
    $String1 = "_unaps.exe "
    ; unfertig $String2 = GUICtrlSetData($Input1, " " & WingetText($aListViews,""))
    $String8 = " "
    $String3 = $aListViews
    Run($String1 & $String2 & $String8 & $String3)

    [/autoit]

    Vielleicht kann mir ja einer helfen, wie ich den Dateinamen als Text auslese ???

  • schreib mal bitte was du überhaupt vorhast.

    ps und poste das script

    EDIT:

    Spoiler anzeigen
    [autoit]

    #include <misc.au3>
    #include <file.au3>

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

    Global $cm_file=@ScriptDir&"\cm.txt"
    If FileExists($cm_file)= 0 Then _FileCreate($cm_file)
    If @Compiled= 1 Then
    If $cmdline[0] <> "" Then
    While 1
    $op=FileOpen($cm_file,1)
    If $op <> -1 Then ExitLoop
    FileClose($op)
    WEnd
    For $i=1 To $cmdline[0]
    FileWriteLine($op,$cmdline[$i])
    Next
    FileClose($op)
    EndIf
    EndIf

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

    If _Singleton("ASSELPUSS",1)= 0 Then Exit

    [/autoit]

    und dan in der While schleife

    Spoiler anzeigen
    [autoit]

    If FileExists($cm_file)=0 Then ContinueLoop
    $process=ProcessList(@ScriptName)
    If $process[0][0]> 1 Then ContinueLoop
    ;cmdline

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

    Switch _FileCountLines($cm_file)
    Case 0
    ContinueLoop
    Case 1
    $cm_read_pointer=FileReadLine($cm_file,-1)
    _FileWriteToLine($cm_file,1,"",1)
    FileDelete($cm_file)
    Case Else
    For $i=1 To _FileCountLines($cm_file)
    $read=FileReadLine($cm_file,-1)
    If $i=1 Then $cm_read_pointer=_get_file_dir($read)&"|"
    $cm_read_pointer=$cm_read_pointer&_get_file_name($read)&"|"
    _FileWriteToLine($cm_file,_FileCountLines($cm_file),"",1)
    Next
    FileDelete($cm_file)
    $cm_read_pointer=StringReplace($cm_read_pointer,"|","",-1)
    EndSwitch

    [/autoit]

    im select oder switch oder if befehl

    case $cm_read_pointer > ""
    $String1 = "_unaps.exe "
    ; unfertig $String2 = GUICtrlSetData($Input1, " " & WingetText($aListViews,""))
    $String8 = " "
    $String3 = $aListViews
    Run($String1 & $cm_read_pointre & $String8 & $String3)
    $cm_read_pointer=""

    2 Mal editiert, zuletzt von Rodny_le_lude (23. März 2010 um 14:50)

  • Die Hilfe zu Kommandozeilenparameter ($cmdline) findest du in der Hilfe unter Allgemeines zu AutoIt (falls du das überhaupt suchst, habe dein Problem nicht verstanden).

    mfg (Auto)Bert

  • Ich hab' es es selber hinbekommen. Aber vielen Dank für Eure Hilfe!!!!

    Spoiler anzeigen
    [autoit]


    Case $Aps
    Local $sItem2, $String4, $string5, $string6, $string7, $string9, $s2

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

    If (GUICtrlRead($Checkbox1) = $GUI_CHECKED or GUICtrlRead($Checkbox2) = $GUI_CHECKED or GUICtrlRead($Checkbox3) = $GUI_CHECKED or GUICtrlRead($Checkbox4) = $GUI_CHECKED or GUICtrlRead($Checkbox5) = $GUI_CHECKED) Then
    MsgBox(0, "", "you must unchecked all columns before you run")
    else
    $String4 = "_aps.exe "
    $s2 = _GUICtrlListView_GetSelectedIndices($hList1, True)
    If $s2[0] > 0 Then
    $sItem2 = _GUICtrlListView_GetItemTextArray($hList1, $s2[1])
    For $s2 = 1 To $sItem2[0]
    $String5 = StringFormat("%s", $sItem2[$s2])
    $String6 = StringFormat("%s", $sItem2[$s2])
    $String7 = "\"
    $String9 = " "
    Next
    Run($String4 & StringMid($String5, 3, 50) & $String9 & $String6 & $String7)
    MsgBox(0, "Information", $String6 & " was packed")
    else
    MsgBox(0, "", "No data selected")
    Endif
    Endif
    Case $UnAps
    Local $sItem, $String1, $string2, $s

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

    If (GUICtrlRead($Checkbox1) = $GUI_CHECKED or GUICtrlRead($Checkbox2) = $GUI_CHECKED or GUICtrlRead($Checkbox3) = $GUI_CHECKED or GUICtrlRead($Checkbox4) = $GUI_CHECKED or GUICtrlRead($Checkbox5) = $GUI_CHECKED) Then
    MsgBox(0, "", "you must unchecked all columns before you run")
    else
    $String1 = "_unaps.exe "
    $s = _GUICtrlListView_GetSelectedIndices($hList1, True)
    If $s[0] > 0 Then
    $sItem = _GUICtrlListView_GetItemTextArray($hList1, $s[1])
    For $s = 1 To $sItem[0]
    $String2 &= StringFormat("%s", $sItem[$s])
    Next
    Run($String1 & $String2)
    MsgBox(0, "Information", $String2 & " was unpacked")
    else
    MsgBox(0, "", "No data selected")
    Endif
    Endif

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