1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. Surfy

Beiträge von Surfy

  • Offene Prozesse abfragen, MSGBox zum schliessen einblenden OK /Cancel - Errorlevel übergeben

    • Surfy
    • 10. August 2011 um 12:28

    @ Misterspeed: Danke, genau in die Richtung wollte ich gehen, inifile hatte ich auch eingeplant - nur war das halt sehr nooblike:

    [autoit]

    $config = (@ScriptDir & "\config.ini")
    $ProcessToCheck = IniRead($config, "Configuration", "ProcessToCheck", "NichtGefunden")
    $AppToInstall = IniRead($config, "Configuration", "AppToInstall", "NichtGefunden")

    [/autoit]

    Wie müsste jetzt die Case Schleife aussehen, damit auch da schon auf

    [autoit]

    $list[$i][0],$list[$i][0]

    [/autoit]

    basis abgefragt wird?

    [autoit]

    Global $abfrage = 0
    While 1
    $list = ProcessList()
    For $i = 1 To $list[0][0]
    Switch $list[$i][0]
    Case $list[$i][0]
    Sleep(1000)
    $Msgbox = MsgBox(8192+65,"Installer","Please close " & $list[$i][0] & " to install an update or new version of " & $AppToInstall )
    If $Msgbox = 2 Then
    Exit(1)
    Endif
    $abfrage = $abfrage + 1
    EndSwitch
    Next
    Sleep(1000)
    WEnd

    [/autoit]


    Ist es wirklich soooo einfach? ?(

  • Offene Prozesse abfragen, MSGBox zum schliessen einblenden OK /Cancel - Errorlevel übergeben

    • Surfy
    • 10. August 2011 um 12:20

    Das wäre irreführend, weil gerade beim PDF - der Fenstertitel der Name des PDF`s wäre.

    Nein, das geht auch nicht ;)

    Ich suche eine Lösung wo ich angeben kann:

    $Query1= AcroRd32.exe

    $Titel1= Acrobat Reader

    Und das für alle Prozesse.

  • Offene Prozesse abfragen, MSGBox zum schliessen einblenden OK /Cancel - Errorlevel übergeben

    • Surfy
    • 10. August 2011 um 11:52

    Hallo zusammen

    Ich will ein Programm via Softwareverteilung auf mehreren Client-PCs installieren, welches erfordert das gewisse Programme geschlossen werden.

    Der User muss aber die Möglichkeit haben, auf die Messagebox mit Ok oder Cancel zu reagieren. Bei Ok muss geprüft werden, ob die Prozesse zu sind, falls ja, darf es im Script weiter gehen, falls nicht, die Messagebox erneut eingeblendet werden.

    Falls Cancel gedrückt wird, müsste die exe mit einem Errorlevel enden.

    Für einen einzelnen Prozess sähe das ca. so aus:


    [autoit]

    While ProcessExists($ProcessToCheck)
    $Msgbox = MsgBox(8192+65,$Titel,"Please close " & $ProcessToCheck & " to install an update or new version of " & $AppToInstall )
    If $Msgbox = 2 Then
    Exit(1)
    Endif
    WEnd

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

    oder mit mehreren könnte es vielleicht so aussehen:

    [autoit]


    $AppToInstall="Office"
    Global $abfrage = 0
    While 1
    $list = ProcessList()
    For $i = 1 To $list[0][0]
    Switch $list[$i][0]
    Case "Winword.exe", "Outlook.exe", "Excel.exe", "Powerpnt.exe", "MSACCESS.EXE", "acrobat.exe", "AcroRd32.exe", "iexplore.exe"
    Sleep(1000)
    $Msgbox = MsgBox(8192+65,"Installer","Please close " & $list[$i][0] & " to install an update or new version of " & $AppToInstall )
    If $Msgbox = 2 Then
    Exit(1)
    Endif
    $abfrage = $abfrage + 1
    EndSwitch
    Next
    Sleep(1000)
    WEnd

    [/autoit]

    Nun zu meinen Problemen / Fragen:

    z.B. der Prozess AcroRd32.exe ist nicht selbsterklärend für den User - wie könnte man erreichen, dass der User aufgefordert wird, Acrobat Reader zu schliessen, und nicht den Namen des laufenden Prozesses?

    Ich hoffe ihr schubst mich von der Leitung, auf der ich stehe ;(

  • Lokalen User anlegen

    • Surfy
    • 5. August 2011 um 08:18

    Machts doch bitte nicht so überladen...

    [autoit]

    RunWait(@COMSPEC & ' /c net user /add "MyUser" MyPassword /Comment:"My First User" /expires:never /passwordchg:no /Y ', "", @SW_HIDE)

    [/autoit]


    Oder startet ein Batchfile:


    net user /add "MyUser" MyPassword /Comment:"My First User" /expires:never /passwordchg:no /Y

    Wie man hier aus einem Einzeiler einen ganzen Script generiert, finde ich übertrieben, angesichts der Anforderungen...

  • mehrere Checkboxen abfragen

    • Surfy
    • 25. Juli 2011 um 13:37

    ;(


    Herzlichen Dank, :thumbup:


    Ich hab das immer falsch plaziert

  • mehrere Checkboxen abfragen

    • Surfy
    • 25. Juli 2011 um 13:30

    Hallo zusammen

    Ich möchte erzwingen, dass der Benutzer zwei verschiedene Combobox eingaben auch gemacht hat, bevor es weitergeht.

    In dem Beispiel von mir, wird der User zwar darauf hingewiesen, dass er die Eingaben zu machen hat - aber es geht weiter im Script.

    Wie erreiche ich, dass er die Abfragen solange macht, bis die Eingaben gemacht wurden?


    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form1", 413, 305, 304, 188)
    $Button1 = GUICtrlCreateButton("Go", 112, 256, 75, 25)
    $Group1 = GUICtrlCreateGroup("Fall1", 64, 56, 185, 81)
    $Radio1 = GUICtrlCreateRadio("Test1", 88, 80, 113, 17)
    $Radio2 = GUICtrlCreateRadio("Test2", 88, 104, 113, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Fall2", 72, 168, 185, 73)
    $Radio3 = GUICtrlCreateRadio("Test1", 96, 192, 113, 17)
    $Radio4 = GUICtrlCreateRadio("Test2", 96, 216, 113, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button2 = GUICtrlCreateButton("Cancel", 232, 256, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    If GUICtrlRead($radio1) ="4" and GUICtrlRead($radio2) = "4" Then
    MsgBox(8192+64, "Attention", "kein Fall 1 ausgewählt", 10)
    EndIf
    If GUICtrlRead($radio3) ="4" and GUICtrlRead($radio4) = "4" Then
    MsgBox(8192+64, "Attention", "kein Fall 2 ausgewählt", 10)
    EndIf
    MsgBox(4096, "Test", "Alle bedingungen erfüllt")

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

    case $Button2
    exit
    EndSwitch
    WEnd

    [/autoit]


    Wo liegt mein Denkfehler?


    Danke für eure Hilfe :)

  • Robocopy Folder exclusion bilden

    • Surfy
    • 22. Juli 2011 um 09:12

    Hallo zusammen

    Ich will zwei Verzeichnisse vergleichen, und alle Unter-Verzeichnisse die nicht in beiden Verzeichnissen enthalten sind - in eine Exclusion-Liste schreiben.

    Robocopy benötigt die Exclusionliste in der Form: "Verzeichniss1" "Verzeichniss" "Verzeichniss3"

    [autoit]

    #include <array.au3>
    #include <File.au3>
    Opt("GUIDataSeparatorChar",'""') ; "|" ist der Standard
    $txt1=_FileListToArray("\\server1\\ntinst\Install\","*","2")
    $txt2=_FileListToArray("\\server2\ntinstT\Install\","*","2")

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

    $ret = _GetIntersection($txt1, $txt2, 0, ' ')
    $diff1 = ''
    $diff2 = ''
    If Not @error Then
    For $i = 0 To UBound($ret) -1
    If $ret[$i][1] <> '' Then $diff1 &= $ret[$i][1] & ' ; '
    If $ret[$i][2] <> '' Then $diff2 &= $ret[$i][2] & ' ; '
    Next
    EndIf
    $completexclusions = $diff1 & $diff2

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

    ;MsgBox(0, '', 'Addiert: ' & $completexclusions)
    ; Dieser Teil will nicht
    ;
    ;

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

    ;==================================================================================================
    ; Function Name: _GetIntersection($Set1, $Set2 [, $GetAll=0 [, $Delim=Default]])
    ; Description:: Detect from 2 sets
    ; - Intersection (elements are contains in both sets)
    ; - Difference 1 (elements are contains only in $Set1)
    ; - Difference 2 (elements are contains only in $Set2)
    ; Parameter(s): $Set1 set 1 (1D-array or delimited string)
    ; $Set2 set 2 (1D-array or delimited string)
    ; optional: $GetAll 0 - only one occurence of every different element are shown (Default)
    ; 1 - all elements of differences are shown
    ; optional: $Delim Delimiter for strings (Default use the separator character set by Opt("GUIDataSeparatorChar") )
    ; Return Value(s): Succes 2D-array [i][0]=Intersection
    ; [i][1]=Difference 1
    ; [i][2]=Difference 2
    ; Failure -1 @error set, that was given as array, is'nt 1D-array
    ; Note: Comparison is case-sensitiv! - i.e. Number 9 is different to string '9'!
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;==================================================================================================
    Func _GetIntersection(ByRef $Set1, ByRef $Set2, $GetAll=0, $Delim=Default)
    Local $o1 = ObjCreate("System.Collections.ArrayList")
    Local $o2 = ObjCreate("System.Collections.ArrayList")
    Local $oUnion = ObjCreate("System.Collections.ArrayList")
    Local $oDiff1 = ObjCreate("System.Collections.ArrayList")
    Local $oDiff2 = ObjCreate("System.Collections.ArrayList")
    Local $tmp, $i
    If $GetAll <> 1 Then $GetAll = 0
    If $Delim = Default Then $Delim = Opt("GUIDataSeparatorChar")
    If Not IsArray($Set1) Then
    If Not StringInStr($Set1, $Delim) Then
    $o1.Add($Set1)
    Else
    $tmp = StringSplit($Set1, $Delim)
    For $i = 1 To UBound($tmp) -1
    $o1.Add($tmp[$i])
    Next
    EndIf
    Else
    If UBound($Set1, 0) > 1 Then Return SetError(1,0,-1)
    For $i = 0 To UBound($Set1) -1
    $o1.Add($Set1[$i])
    Next
    EndIf
    If Not IsArray($Set2) Then
    If Not StringInStr($Set2, $Delim) Then
    $o2.Add($Set2)
    Else
    $tmp = StringSplit($Set2, $Delim)
    For $i = 1 To UBound($tmp) -1
    $o2.Add($tmp[$i])
    Next
    EndIf
    Else
    If UBound($Set2, 0) > 1 Then Return SetError(1,0,-1)
    For $i = 0 To UBound($Set2) -1
    $o2.Add($Set2[$i])
    Next
    EndIf
    For $tmp In $o1
    If $o2.Contains($tmp) And Not $oUnion.Contains($tmp) Then $oUnion.Add($tmp)
    Next
    For $tmp In $o2
    If $o1.Contains($tmp) And Not $oUnion.Contains($tmp) Then $oUnion.Add($tmp)
    Next
    For $tmp In $o1
    If $GetAll Then
    If Not $oUnion.Contains($tmp) Then $oDiff1.Add($tmp)
    Else
    If Not $oUnion.Contains($tmp) And Not $oDiff1.Contains($tmp) Then $oDiff1.Add($tmp)
    EndIf
    Next
    For $tmp In $o2
    If $GetAll Then
    If Not $oUnion.Contains($tmp) Then $oDiff2.Add($tmp)
    Else
    If Not $oUnion.Contains($tmp) And Not $oDiff2.Contains($tmp) Then $oDiff2.Add($tmp)
    EndIf
    Next
    Local $UBound[3] = [$oDiff1.Count,$oDiff2.Count,$oUnion.Count], $max = 1
    For $i = 0 To UBound($UBound) -1
    If $UBound[$i] > $max Then $max = $UBound[$i]
    Next
    Local $aOut[$max][3]
    If $oUnion.Count > 0 Then
    $i = 0
    For $tmp In $oUnion
    $aOut[$i][0] = $tmp
    $i += 1
    Next
    EndIf
    If $oDiff1.Count > 0 Then
    $i = 0
    For $tmp In $oDiff1
    $aOut[$i][1] = $tmp
    $i += 1
    Next
    EndIf
    If $oDiff2.Count > 0 Then
    $i = 0
    For $tmp In $oDiff2
    $aOut[$i][2] = $tmp
    $i += 1
    Next
    EndIf
    Return $aOut
    EndFunc ;==>_GetIntersection

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


    Ich bin schon so verzeifelt, dass ich versucht habe, mit

    [autoit]


    $myFile = FileOpen(@ScriptDir & '\textfile.txt', 1)
    For $i = 1 To $completexclusions[0]
    FileWriteLine ($myFile, '"' & $completexclusions[$i] & '"')
    Next
    FileClose($myFile)

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

    ein File anzulegen, um dieses später wieder einzulesen. Zeilenumbrüche entfernen traue ich mir dann wieder zu :wacko:

    Auch versuche mit;

    [autoit]

    $array = StringSplit($diff2, ' ;', 1)
    _ArrayDisplay($array)
    $nimmerarray=_ArrayToString($Array, ' "', 1,50)

    [/autoit]

    oder

    [autoit]

    Opt("GUIDataSeparatorChar",'""')

    [/autoit]

    Alles nur käse ;(

    Ich hoffe ihr wisst rat.

  • Array bearbeiten / verwenden und die Trennzeichen

    • Surfy
    • 19. Juli 2011 um 07:54

    Egal wo ich da ansetze, es will einfach nicht:

    [autoit]

    Opt("GUIDataSeparatorChar",'""')

    [/autoit]
  • Array bearbeiten / verwenden und die Trennzeichen

    • Surfy
    • 18. Juli 2011 um 18:47

    Das scheint logisch: ;)

    $ret = _GetIntersection($txt1, $txt2, 0, '"')

    Allerdings scheine ich da auch auch noch ein Problemchen zu haben, die Gänsefüssen entstehen nicht wie gewünscht :(

  • Array bearbeiten / verwenden und die Trennzeichen

    • Surfy
    • 18. Juli 2011 um 18:42

    Danke für den Tip!

    Ich probiersmal mit dem Spoiler :love:

    Spoiler anzeigen
    [autoit]

    ]#include <array.au3>
    #include <File.au3>

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

    $txt1=_FileListToArray("c:\temp1\","*","2")
    $txt2=_FileListToArray("c:\temp2\","*","2")

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

    $ret = _GetIntersection($txt1, $txt2, 0, ' ')
    $diff1 = ''
    $diff2 = ''
    If Not @error Then
    For $i = 0 To UBound($ret) -1
    If $ret[$i][1] <> '' Then $diff1 &= $ret[$i][1] & ' ; '
    If $ret[$i][2] <> '' Then $diff2 &= $ret[$i][2] & ' ; '
    Next
    EndIf
    MsgBox(0, '', 'Unterschiede 1: ' & $diff1 & @LF & 'Unterschiede 2: ' & $diff2)

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

    ;_ArrayToString($diff2, "|", 1, 7))

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

    $array = StringSplit($diff2, ' ;', 1)
    _ArrayDisplay($array)
    $nimmerarray=_ArrayToString($Array, ' "', 1,50)

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

    MsgBox(0, "_ArrayToString() erhält von $avArray die Items 1 bis 7", _ArrayToString($Array, '"', 1,50))

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

    $sIni = @ScriptDir & "\debug.ini"
    $counter = IniRead($sIni, @ComputerName, "Counter", "")
    $recount=$counter + 1
    $sData = "Username=" & @UserName & @LF & "Computername=" & @ComputerName & @LF & "Uhrzeit=" & @HOUR & ":" & @MIN & @LF & "Datum=" & @MDAY & "." & @MON & "." & @YEAR & @LF & "Counter=" & $recount & @LF & "Diff1="& $diff1 & @LF & "Diff2=" & $diff2& @LF & "Bearbeitet=" & $nimmerarray
    IniWriteSection($sIni, @ComputerName, $sData)

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

    ;==================================================================================================
    ; Function Name: _GetIntersection($Set1, $Set2 [, $GetAll=0 [, $Delim=Default]])
    ; Description:: Detect from 2 sets
    ; - Intersection (elements are contains in both sets)
    ; - Difference 1 (elements are contains only in $Set1)
    ; - Difference 2 (elements are contains only in $Set2)
    ; Parameter(s): $Set1 set 1 (1D-array or delimited string)
    ; $Set2 set 2 (1D-array or delimited string)
    ; optional: $GetAll 0 - only one occurence of every different element are shown (Default)
    ; 1 - all elements of differences are shown
    ; optional: $Delim Delimiter for strings (Default use the separator character set by Opt("GUIDataSeparatorChar") )
    ; Return Value(s): Succes 2D-array [0]=Intersection
    ; [1]=Difference 1
    ; [2]=Difference 2
    ; Failure -1 @error set, that was given as array, is'nt 1D-array
    ; Note: Comparison is case-sensitiv! - i.e. Number 9 is different to string '9'!
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ;==================================================================================================
    Func _GetIntersection(ByRef $Set1, ByRef $Set2, $GetAll=0, $Delim=Default)
    Local $o1 = ObjCreate("System.Collections.ArrayList")
    Local $o2 = ObjCreate("System.Collections.ArrayList")
    Local $oUnion = ObjCreate("System.Collections.ArrayList")
    Local $oDiff1 = ObjCreate("System.Collections.ArrayList")
    Local $oDiff2 = ObjCreate("System.Collections.ArrayList")
    Local $tmp, $i
    If $GetAll <> 1 Then $GetAll = 0
    If $Delim = Default Then $Delim = Opt("GUIDataSeparatorChar")
    If Not IsArray($Set1) Then
    If Not StringInStr($Set1, $Delim) Then
    $o1.Add($Set1)
    Else
    $tmp = StringSplit($Set1, $Delim)
    For $i = 1 To UBound($tmp) -1
    $o1.Add($tmp[$i])
    Next
    EndIf
    Else
    If UBound($Set1, 0) > 1 Then Return SetError(1,0,-1)
    For $i = 0 To UBound($Set1) -1
    $o1.Add($Set1[$i])
    Next
    EndIf
    If Not IsArray($Set2) Then
    If Not StringInStr($Set2, $Delim) Then
    $o2.Add($Set2)
    Else
    $tmp = StringSplit($Set2, $Delim)
    For $i = 1 To UBound($tmp) -1
    $o2.Add($tmp[$i])
    Next
    EndIf
    Else
    If UBound($Set2, 0) > 1 Then Return SetError(1,0,-1)
    For $i = 0 To UBound($Set2) -1
    $o2.Add($Set2[$i])
    Next
    EndIf
    For $tmp In $o1
    If $o2.Contains($tmp) And Not $oUnion.Contains($tmp) Then $oUnion.Add($tmp)
    Next
    For $tmp In $o2
    If $o1.Contains($tmp) And Not $oUnion.Contains($tmp) Then $oUnion.Add($tmp)
    Next
    For $tmp In $o1
    If $GetAll Then
    If Not $oUnion.Contains($tmp) Then $oDiff1.Add($tmp)
    Else
    If Not $oUnion.Contains($tmp) And Not $oDiff1.Contains($tmp) Then $oDiff1.Add($tmp)
    EndIf
    Next
    For $tmp In $o2
    If $GetAll Then
    If Not $oUnion.Contains($tmp) Then $oDiff2.Add($tmp)
    Else
    If Not $oUnion.Contains($tmp) And Not $oDiff2.Contains($tmp) Then $oDiff2.Add($tmp)
    EndIf
    Next
    Local $UBound[3] = [$oDiff1.Count,$oDiff2.Count,$oUnion.Count], $max = 1
    For $i = 0 To UBound($UBound) -1
    If $UBound[$i] > $max Then $max = $UBound[$i]
    Next
    Local $aOut[$max][3]
    If $oUnion.Count > 0 Then
    $i = 0
    For $tmp In $oUnion
    $aOut[$i][0] = $tmp
    $i += 1
    Next
    EndIf
    If $oDiff1.Count > 0 Then
    $i = 0
    For $tmp In $oDiff1
    $aOut[$i][1] = $tmp
    $i += 1
    Next
    EndIf
    If $oDiff2.Count > 0 Then
    $i = 0
    For $tmp In $oDiff2
    $aOut[$i][2] = $tmp
    $i += 1
    Next
    EndIf
    Return $aOut
    EndFunc ;==>_GetIntersection

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


    Die Messagebox Ergebnisse sehen nun schon vielversprechend aus, aber so ein richtiger String scheint es noch nicht zu sein, den im Logfile landet nur ein leerer Eintrag.


    Das ganze scheint auch nur ein Gänsefüsschen zu setzten, für das Strichkomma welches ich als Trennzeichen ersetze. Wie ich auch an den Anfang ein Strichkomma bekomme, ist mir noch schleierhaft.


    Vielleicht habt ihr mir auch dazu eine Hilfestellung ;)




    Surfy

  • Array bearbeiten / verwenden und die Trennzeichen

    • Surfy
    • 18. Juli 2011 um 17:29
    [autoit]

    #include <array.au3>
    #include <File.au3>

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

    $txt1=_FileListToArray("c:\testdir1\","*","2")
    $txt2=_FileListToArray("c:\testdir2\","*","2")

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

    $ret = _GetIntersection($txt1, $txt2, 0, ' ')
    $diff1 = ''
    $diff2 = ''
    If Not @error Then
    For $i = 0 To UBound($ret) -1
    If $ret[$i][1] <> '' Then $diff1 &= $ret[$i][1] & ' ; '
    If $ret[$i][2] <> '' Then $diff2 &= $ret[$i][2] & ' ; '
    Next
    EndIf
    MsgBox(0, '', 'Unterschiede 1: ' & $diff1 & @LF & 'Unterschiede 2: ' & $diff2)

    [/autoit]

    Das Ergebniss sieht so aus:

    .....Dir1; ....dir2 ; ....Dir Mytest ;

    Wie bekomme ich nun eine Liste in der Form:

    "....Dir1" "....Dir2" ".... Dir Mytest"

    Gar nicht so einfach, das ganze ;(

  • Die Unter-Ordner von zwei Verzeichnissen vergleichen, mit einer Pfadtiefe von 0

    • Surfy
    • 18. Juli 2011 um 15:41

    DAS ist mir nun wirklich peinlich :wacko: - sorry!

  • Die Unter-Ordner von zwei Verzeichnissen vergleichen, mit einer Pfadtiefe von 0

    • Surfy
    • 18. Juli 2011 um 13:46

    Hallo zusammen

    Ich will zwei Verzeichnisse in Arrays einlesen, nur die Ordner, und in einem dritten Array alle unterschiedlichen Ordner festhalten.

    Und das ganze mit einer Pfadtiefe von 0 - dh keine Unterordner.

    Ich habe von Bugfix die Function _GetFilesFolder_Rekursiv gefunden, leider geht die aber auch in alle Unterverzeichnisse [ offen ] Dateien in Netzwerkordner auslesen (UNC-Pfad)

    Das Vergleichen der Arrays geht ja mit Bugfix seiner _GetIntersection Fuction :thumbup:

    Nur wie erhalte ich ein Array einer Ordnerstruktur - ohne die Dateien und Unterordner?

  • Gewählter Dropbox Wert / GUICtrlCreateCombo abfragen

    • Surfy
    • 14. Juli 2011 um 14:30

    Ich bin gerade das erste mal am Gui basteln *rotwerd*

    Danke Dir, das wars! :whistling:

  • Gewählter Dropbox Wert / GUICtrlCreateCombo abfragen

    • Surfy
    • 14. Juli 2011 um 14:23

    Hallo zusammen

    Wie komme ich an den Wert, den der User in der Dropdownbox ausgewählt hat?

    [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    ;##################################################################

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

    $config = (@ScriptDir & "\config.ini")
    $Mylist = IniRead($config, "Configuration", "liste", "NichtGefunden")
    ;Content INI: liste=server1|server2|server3
    ;##################################################################

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

    #Region ### START Koda GUI section ### Form=h:\_auto-it\robocopy\formdesign.kxf
    $Form1_1 = GUICreate("Tool", 501, 501, 273, 142)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    $Label = GUICtrlCreateLabel("MyList:", 280, 56, 31, 20)
    GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    $Target = GUICtrlCreateCombo("", 280, 80, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, $Mylist, "item3") ; add other item snd set a new default
    $GO = GUICtrlCreateButton("GO", 128, 424, 75, 25)
    $Cancel = GUICtrlCreateButton("Cancel", 264, 424, 75, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $GO
    MsgBox(4096, "Test", $Label, 10)
    Case $Cancel
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Das ist jetzt sicher DIE n00b frage schlechthin ;(

    Surfy

  • StdoutRead auslesen

    • Surfy
    • 13. Juli 2011 um 14:23

    Danke für deine Hilfe!

    Es sind 177 GB an Daten, mit einer Dateigrösse von mini bis zu 2 GB.

    Das mit dem Exitloop war schon ein klasse tip!

    Das Hochzählen und anzeigen, klappt hingehen nicht :-/ Ich probiers nun mal mit XXL Dateien

  • StdoutRead auslesen

    • Surfy
    • 13. Juli 2011 um 13:49

    Danke Dir Adrenalinjunkie. Aber dein Script ist viel zu komplex für meinen Skill. Und daher bekomme ich das erst recht nicht zum laufen.

    Der kleine Script den ich da gefunden / gepostet habe, der wäre genau passend

  • StdoutRead auslesen

    • Surfy
    • 13. Juli 2011 um 11:31

    Das kommt dabei raus:

    Zitat

    @@ Debug(22) : $currentRead =
    >Error code: 0

    Und davon ganz viele Einträge :huh:

  • StdoutRead auslesen

    • Surfy
    • 13. Juli 2011 um 10:45

    Hallo TheLuBu

    While 1
    $line = StdoutRead($currentRead)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $currentRead)
    Wend

    ergibt einfach gar nichts, wenn ich das an Zeile 28 einfüge. Wenn ich nur MsgBox(0, "STDOUT read:", $currentRead) einpflanze, dann erhalte ich eine leere Msgbox.


    Aber wie kann $currentread leer sein? Das mit dem auslesen klappt doch prinzipiell, was meine auskommentierte Msgbox aus Post1 auch zeigt...

  • StdoutRead auslesen

    • Surfy
    • 13. Juli 2011 um 10:03

    Hallo zusammen

    Aus dem englischen Forum habe ich diese feinen Zeilen entdeckt. So rein nach Msgbox funktioniert das StdoutRead Auslesen gut. Nur die Progressbar bleibt bei 0% zeigt nichts an, und schliesst sich auch nicht wenn der kopiervorgang beendet ist ?(

    [autoit]

    #include <Constants.au3>
    $sourcedir = "c:\test\"
    $destdir = "c:\tocopy2\"
    $result=""
    $ourProcess = Run (@ComSpec & " /c " & 'robocopy.exe ' & $sourcedir & ' ' & $destdir & ' /E /NJH /NJS /NDL /NC', @ScriptDir, @SW_HIDE, $STDOUT_CHILD)
    ProgressOn("RoboCopy", "Copying Files...", "0%",-1,-1,18)
    While 1
    If $ourProcess Then
    $charsWaiting = StdoutRead($ourProcess, 0 , 1)
    If @error = -1 Then
    $ourProcess = 0
    MsgBox(0, "App Exited", "Process has exited...")
    ContinueLoop
    EndIf
    ;While 1
    ; $line = StdoutRead($ourProcess)
    ; If @error Then ExitLoop
    ; MsgBox(0, "STDOUT read:", $line)
    ;Wend
    If $charsWaiting Then
    $currentRead = StdoutRead($ourProcess)
    $fileinfo = StringRegExp($currentRead, '(.*?)([:alpha:]:.*\.[a-zA-Z]{3})',3)
    If IsArray($fileinfo) = 1 Then
    $filesize = StringStripCR(StringStripWS($fileinfo[0],8))
    $filename = $fileinfo[1]
    EndIf
    $percent = StringRegExp($currentRead, '([0-9]{1,3})(?:.[0-9]{1,3})(?:%)',3)
    If IsArray($percent) = 1 Then
    ProgressSet($percent[0],$percent[0]&"% "&@CRLF&"Filename: "&$filename&@CRLF&"Filesize: "&$filesize)
    EndIf
    If IsArray($result) Then
    If StringInStr($result[0], "%") Then; Current line is a progress update line
    $progress = StringTrimRight($result[0], 1)
    MsgBox (4096,"Test", $progress)
    EndIf
    EndIf
    EndIf
    EndIf
    WEnd
    ProgressOff()
    Exit

    [/autoit]

    Sieht jemand den Fehler? Das wäre genau der Script, den ich gerade gut gebrauchen könnte ;)

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™