Jump to content
Sign in to follow this  
dozosama

[...]creation Logs - (Moved)

Recommended Posts

Hi all i creation logs can help me 

 

I give you me code and after me probleme 

mon code :

 
    #include <Date.au3>
    ; Variable to ecrire in the fichier text
Local $ currentDate = _DateTimeFormat (_NowCalc (), 2)
Local $ currentTime = _DateTimeFormat (_NowCalc (), 5)
Variable $ locale = 125
    Global $ filename = @ScriptDir & "\ log \ logfile.txt"
Mode $ global = 10; 2 + 8 (effacer + créer le répertoire)
Global $ file = FileOpen ($ nomfichier, mode $)
    ; Ecriture dans le fichier texte
FileWriteLine ($ fichier, "")
FileWriteLine ($ file, "___________________")
FileWriteLine ($ fichier, "| |")
FileWriteLine ($ fichier, "| journal DEBUT |")
FileWriteLine ($ file, "| ___________________ |")
FileWriteLine ($ fichier, "")
FileWriteLine ($ fichier, "")
FileWriteLine ($ file, "Informations générales")
FileWriteLine ($ file, "------------------------")
FileWriteLine ($ file, "-> Début du traitement lancé le" & $ currentDate & "à" & $ currentTime)
FileWriteLine ($ fichier, "-> $ variable =" & $ variable)
    
Dim $ Array [13] = ["logiciel 0", _; 0 
    
"logiciel 1", _; 1 
"logiciel 2", _; 2 
"logiciel 3", _; 3 
"logiciel 4", _; 4 
"logiciel 5", _; 5 
"logiciel 6", _; 6 
"logiciel 7", _; 7 
"logiciel 8", _; 8 
"logiciel 9", _; 9  
"logiciel 10", _; dix 
"logiciel 11", _; 11 
"logiciel 12"]; 12 
    $ dimension = $ Array [0]
    Pour $ i = 0 To UBound; de 0 à la fin soit 13 ici
    Sommeil (10)
    if FileExists ($ Array [$ i]) Alors; test tout les chemins du tableau (var $ i)
        TrayTip ("tous", "ok", 10000); dit si tout est bon 
    Autre
        TrayTip ("/! \ Probleme", "l'unique nom du logiciel n'est pas bon", 10000); dit si il a 1 faute 
    Fin si
    Suivant
    ; Ouverture du fichier log avec bloc-notes
Run ("notepad.exe" & $ filename)
     

Me notepad dont run whit that code 

 

code :

 

 
    #include <Date.au3>
    ; Variable to ecrire in the text text 
Local $ currentDate = _DateTimeFormat (_NowCalc (), 2) 
Local $ currentTime = _DateTimeFormat (_NowCalc (), 5) 
Variable locale $ 125
    Global $ filename = @ScriptDir & "\ log \ logfile.txt" 
Global $ mode = 10; 2 + 8 (effacer + créer 
un répertoire ) Global $ file = FileOpen ($ filename, $ mode)
    ; Ecriture Dans le fichier texte 
FileWriteLine ($ file, "") 
FileWriteLine ($ file, » ___________________ ") 
FileWriteLine ($ file," | | ") 
FileWriteLine ($ file," | DÉBUTS journal | ") 
FileWriteLine ($ file," | ___________________ | ") 
FileWriteLine ($ fichier," ") 
FileWriteLine ($ fichier," ") 
FileWriteLine ($ fichier," Informations générales ") 
FileWriteLine ($ fichier," ------------- ----------- ") 
FileWriteLine ($ file," -> Début du traitement lancé le "& $ currentDate &" à "& $ currentTime) 
FileWriteLine ($ file," -> $ variable = "& $ variable)
    ; Ouverture du fichier log avec notepad 
Run ("notepad.exe" & $ filename)
    Dim $ Array [13] = ["logiciel 0", _; 0 
    
"logiciel 1", _; 1  
"logiciel 2", _; 2  
"logiciel 3", _; 3  
"logiciel 4", _; 4  
"logiciel 5", _; 5  
"logiciel 6", _; 6  
"logiciel 7", _; 7  
"logiciel 8", _; 8  
"logiciel 9", _; 9   
"logiciel 10", _; 10  
"logiciel 11", _; 11  
"logiciel 12"]; 12 
    $ dimension = $ Array [0]
    Pour $ i = 0 To UBound; de 0 à la fin soit 13 ici 
    Sleep (10) 
    si FileExists ($ Array [$ i]) Then; tester tout les chemins du tableau (var $ i) 
        TrayTip ("all", "ok", 10000); dit si tout est bon  
    Else 
        TrayTip ("/! \ probleme", "l'un des noms de logiciel n'est pas bon", 10000); dit si il a 1 faute  
    EndIf
    Suivant

 

jand that code notepad run juste no give me logs 

can one dude help me ? (sorry for fault im franch)

where take logs code (  https://autoitscript.fr/forum/viewtopic.php?t=3597  (franch forum autoit))  

i have tested a lot code for programme 

Thank you for help and good day all

Edited by dozosama

Share this post


Link to post
Share on other sites

Seems like you have an issue with your formatting. 
I cleaned up your code and also   your variables had a space between the $ and the variable name.

PS: your welcome to translate my English to French. 

 

#include <Date.to3>
    ; Variable to write in the text text
Local $currentDate = _DateTimeFormat (_NowCalc (), 2) 
Local $currentTime = _DateTimeFormat (_NowCalc (), 5) 
Local $variable = 125
    Global $filename = @ScriptDir & "\log\logfile.txt" 
Global $mode = 10   ; 2 + 8 (erase + create a directory) Global $ file = FileOpen($filename, $mode)
                    ; Writing In the text file
FileWriteLine($file, "") 
FileWriteLine($file, "___________________") 
FileWriteLine($file, "| |") 
FileWriteLine($file, "| START journal |") 
FileWriteLine($file, "| ___________________ |") 
FileWriteLine($file, "") 
FileWriteLine($file, "") 
FileWriteLine($file, "General Information") 
FileWriteLine($file, "------------- -----------") 
FileWriteLine($file, "-> Start of processing started the" & $currentDate & "at" & $currentTime) 
FileWriteLine($file, "-> " & $variable & "  =" & $variable)
    ; Openinglog file with notepad
Run ("notepad.exe" & $filename)
    Dim $Array [13] = ["software 0", _; 0
    
"software 1", _; 1  
"software 2", _; 2  
"software 3", _; 3  
"software 4", _; 4  
"software 5", _; 5  
"software 6", _; 6  
"software 7", _; 7  
"software 8" _; 8  
"software 9", _; 9   
"software 10", _; 10  
"software 11", _; 11  
"software 12"]; 12
    $dimension = $Array [0]
    For $i = 0 To UBound; from 0 to the end is 13 here
    Sleep (10) 
    if FileExists ($Array [$i]) Then; test all the paths of the array (var $ i)
        TrayTip ("all", "ok", 10000); says if everything is good  
    else 
        TrayTip ("/! \ Problem", "one of the software names is not good", 10000); says if he has 1 fault  
    EndIf

 


Kind Regards
Skeletor

"I need coffee to turn me back to a human"

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen

Share this post


Link to post
Share on other sites

Non me folder log is good created juste empty 

 

Juste in me folder log and me notpade logfille.txt  not log is empty i can screen tell me your question

 

thank you again for help !!

Edited by dozosama

Share this post


Link to post
Share on other sites

#include <Date.au3>
    ; Variable à ecrire dans le fichier texte
Local $currentDate = _DateTimeFormat( _NowCalc(), 2)
Local $currentTime = _DateTimeFormat( _NowCalc(), 5)
Local $variable = 125
    ;~ filename Filename of the text file to open.
;~ mode Mode (read or write) to open the file in.
;~ Can be a combination of the following:
;~   0 = Read mode
;~   1 = Write mode (append to end of file)
;~   2 = Write mode (erase previous contents)
;~   4 = Read raw mode
;~   8 = Create directory structure if it doesn't exist (See Remarks).
;~   16 = Force binary(byte) reading and writing mode with FileRead and FileWrite
;~   32 = Use Unicode UTF16 Little Endian reading and writing mode. Reading does not override existing BOM
;~   64 = Use Unicode UTF16 Big Endian reading and writing mode. Reading does not override existing BOM
;~   128 = Use Unicode UTF8 reading and writing mode. Reading does not override existing BOM
;~ Both write modes will create the file if it does not already exist. The folder path must already exist (except using mode '8' - See Remarks).
Global $filename = @ScriptDir&"\log\logfile.txt"
Global $mode = 10 ; 2 + 8 (erase + create dir)
Global $file = FileOpen($filename, $mode)
    ; Ecriture dans le fichier texte
FileWriteLine($file,"")
FileWriteLine($file," ___________________")
FileWriteLine($file,"|                   |")
FileWriteLine($file,"|     DEBUT log     |")
FileWriteLine($file,"|___________________|")
FileWriteLine($file,"")
FileWriteLine($file,"")
FileWriteLine($file,"   Informations générales")
FileWriteLine($file,"  ------------------------")
FileWriteLine($file,"    -> Début du traitement lancé le "&$currentDate&" à "&$currentTime)
FileWriteLine($file,"    -> $variable = "&$variable)
    ; Ouverture du fichier log avec notepad
Run("notepad.exe "&$filename)
    
                                            ;coin variable
    
             Global $01path  = "M:\01_INSTALLATION_POSTE\Logiciels_13-02-201\" ;le chemin
    
                                            ;Tableau
    Dim $Array [13] = ["01_googlechromestandaloneenterprise64.msi", _    ; 0 Google
"02_Firefox Setup 65.0.1.exe", _                                     ; 1 Firefox
"03_install_flash_player_32_active_x.msi", _                         ; 2 Flash active
"03_install_flash_player_32_plugin.msi", _                             ; 3 Flash plugin
"04_AdobeAIRInstaller.exe", _                                        ; 4 Adobe
"05_sw_lic_full_installer.msi", _                                     ; 5 Shockwave
"06_jre-8u201-windows-x64.exe", _                                     ; 6 Java
"07_AcroRdrDC1901020091_fr_FR.exe" , _                                 ; 7 Acrordr
"08_winrar-x64-561fr.exe", _                                         ; 8 Winrar
"09_7z1806-x64.exe", _                                                 ; 9 Zip
"10_gimp-2.10.8-setup-2.exe", _                                     ; 10 Gimp
"11_vlc-3.0.6-win64.exe" , _                                         ; 11 Vlc
"12_LibreOffice_6.1.5_Win_x64.msi"]                                 ; 12 Libreoffice
    
                                            ; debut de de la boucle
    
If FileExists ($01path) Then ; test le chemin principale
    TrayTip ("path","C'est bon pas de probleme",1000)
Else
    TrayTip ("/!\ path","probleme de chemin a swap",1000)
EndIf
    For $i = 0 To UBound($Array) ; crée une variable qui dit de 0 a Ubound (la fin du tableau)
    Sleep (10) ; millisec
    if FileExists ($01path & $Array[$i]) Then ; test le chemin principale avec les nom des logiciel
        TrayTip ("Logiciel","Les nom de logiciel sont bon",1000)
    Else
        TrayTip ("/!\ probleme","l'un des nom de logiciel  est pas bon",1000)
    EndIf
    Next
    
                                            ;debut de l'install
    
ProcessWaitClose (ShellExecute ($Array[0]))                 ;Google

 

Is me really code 

sorry for < ;comments litel comments in french>

Edited by dozosama

Share this post


Link to post
Share on other sites

Try this:
 

#include <Date.au3>
    ; Variable to write in the text text
Local $currentDate = _DateTimeFormat (_NowCalc (), 2)
Local $currentTime = _DateTimeFormat (_NowCalc (), 5)
Local $variable = 125

    Global $filename = @ScriptDir & "\log\"
    Local $fFile = "logfile.txt"



Global $mode = 10   ; 2 + 8 (erase + create a directory) Global $ file = FileOpen($filename, $mode)
                    ; Writing In the text file

If FileExists($filename & $fFile) Then

FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, " ___________________")
FileWriteLine($filename & $fFile, "|                  |")
FileWriteLine($filename & $fFile, "|   START journal  |")
FileWriteLine($filename & $fFile, "|___________________|")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "General Information")
FileWriteLine($filename & $fFile, "------------- -----------")
FileWriteLine($filename & $fFile, "-> Start of processing started the " & $currentDate & " at " & $currentTime)
FileWriteLine($filename & $fFile, "-> " & $variable & "  =  " & $variable)
    ; Openinglog file with notepad

Else
    DirCreate($filename)
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "___________________")
FileWriteLine($filename & $fFile, "| |")
FileWriteLine($filename & $fFile, "| START journal |")
FileWriteLine($filename & $fFile, "| ___________________ |")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "General Information")
FileWriteLine($filename & $fFile, "------------- -----------")
FileWriteLine($filename & $fFile, "-> Start of processing started the" & $currentDate & "at" & $currentTime)
FileWriteLine($filename & $fFile, "-> " & $variable & "  =" & $variable)
    ; Openinglog file with notepad
EndIf

Dim $Array [13]

$Array[0] = "software 0"        ; 0

$Array[1] = "software 1"        ; 1
$Array[2] = "software 2"        ; 2
$Array[3] = "software 3"        ; 3
$Array[4] = "software 4"        ; 4
$Array[5] = "software 5"        ; 5
$Array[6] = "software 6"        ; 6
$Array[7] = "software 7"        ; 7
$Array[8] = "software 8"        ; 8
$Array[9] = "software 9"        ; 9
$Array[10] = "software 10"      ; 10
$Array[11] = "software 11"      ; 11
$Array[12] = "software 12"      ; 12

    $dimension = $Array [0]
    For $i = 0 To UBound; from 0 to the end is 13 here
    Sleep (10)
    if FileExists ($Array [$i]) Then; test all the paths of the array (var $ i)
        TrayTip ("all", "ok", 10000); says if everything is good
    else
        TrayTip ("/! \ Problem", "one of the software names is not good", 10000); says if he has 1 fault
    EndIf
    Next

 


Kind Regards
Skeletor

"I need coffee to turn me back to a human"

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen

Share this post


Link to post
Share on other sites

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@dozosama Try this:

Jsut refined the Array and added a second... Tray Tip does not work in Windows 10..
And for the life of me , I cannot understand why when I paste code, it's showing "At the roof" instead of AutoIt... its only for this topic, works fine everywhere else.

#include <Date.au3>
#include <TrayConstants.au3>


; Variable to write in the text text
Local $currentDate = _DateTimeFormat (_NowCalc (), 2)
Local $currentTime = _DateTimeFormat (_NowCalc (), 5)
Local $variable = 125

    Global $filename = @ScriptDir & "\log\"
    Local $fFile = "logfile.txt"



Global $mode = 10   ; 2 + 8 (erase + create a directory) Global $ file = FileOpen($filename, $mode)
                    ; Writing In the text file

If FileExists($filename & $fFile) Then

FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "  ___________________")
FileWriteLine($filename & $fFile, "|                     |")
FileWriteLine($filename & $fFile, "|    START journal    |")
FileWriteLine($filename & $fFile, "| ___________________ |")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "General Information")
FileWriteLine($filename & $fFile, "------------- -----------")
FileWriteLine($filename & $fFile, "-> Start of processing started the " & $currentDate & " at " & $currentTime)
FileWriteLine($filename & $fFile, "-> " & $variable & "  =  " & $variable)
    ; Openinglog file with notepad

Else
    DirCreate($filename)
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "  ___________________")
FileWriteLine($filename & $fFile, "|                     |")
FileWriteLine($filename & $fFile, "|    START journal    |")
FileWriteLine($filename & $fFile, "| ___________________ |")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "")
FileWriteLine($filename & $fFile, "General Information")
FileWriteLine($filename & $fFile, "------------- -----------")
FileWriteLine($filename & $fFile, "-> Start of processing started the" & $currentDate & "at" & $currentTime)
FileWriteLine($filename & $fFile, "-> " & $variable & "  =" & $variable)
    ; Openinglog file with notepad
EndIf

Dim $Array [13] = ["software 0", "software 1", "software 2", "software 3", "software 4", "software 5", "software 6", "software 7", "software 8", "software 9", "software 10", "software 11", "software 12"]

    For $i = 0 To 13 - 1
    Sleep (1000)
    if FileExists($Array[$i]) Then; test all the paths of the array (var $ i)
        TrayTip("all", "ok", 10000, $TIP_ICONASTERISK)

    else
        TrayTip("/! \ Problem", "one of the software names is not good", 10000, $TIP_ICONASTERISK); says if he has 1 fault
    EndIf
    Next

 


Kind Regards
Skeletor

"I need coffee to turn me back to a human"

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen

Share this post


Link to post
Share on other sites

Sry for late 

 

look me probleme 

 

 

Thank for help

    #include <Date.au3>
    #include <TrayConstants.au3>
    
    ; Variable to write in the text text
    Local $currentDate = _DateTimeFormat (_NowCalc (), 2)
    Local $currentTime = _DateTimeFormat (_NowCalc (), 5)
    Local $variable = 125
            Global $filename = @ScriptDir & "\log\"
        Local $fFile = "logfile.txt"
        Global $mode = 10   ; 2 + 8 (erase + create a directory) Global $ file = FileOpen($filename, $mode)
                        ; Writing In the text file
        If FileExists($filename & $fFile) Then
        FileWriteLine($filename & $fFile, "")
    FileWriteLine($filename & $fFile, "  ___________________")
    FileWriteLine($filename & $fFile, "|                     |")
    FileWriteLine($filename & $fFile, "|    START journal    |")
    FileWriteLine($filename & $fFile, "| ___________________ |")
    FileWriteLine($filename & $fFile, "")
    FileWriteLine($filename & $fFile, "")
    FileWriteLine($filename & $fFile, "General Information")
    FileWriteLine($filename & $fFile, "------------- -----------")
    FileWriteLine($filename & $fFile, "-> Start of processing started the " & $currentDate & " at " & $currentTime)
    FileWriteLine($filename & $fFile, "-> " & $variable & "  =  " & $variable)
        ; Openinglog file with notepad
        Else
        DirCreate($filename)
    FileWriteLine($filename & $fFile, "")
    FileWriteLine($filename & $fFile, "  ___________________")
    FileWriteLine($filename & $fFile, "|                     |")
    FileWriteLine($filename & $fFile, "|    START journal    |")
    FileWriteLine($filename & $fFile, "| ___________________ |")
    FileWriteLine($filename & $fFile, "")
    FileWriteLine($filename & $fFile, "")
    FileWriteLine($filename & $fFile, "General Information")
    FileWriteLine($filename & $fFile, "------------- -----------")
    FileWriteLine($filename & $fFile, "-> Start of processing started the" & $currentDate & "at" & $currentTime)
    FileWriteLine($filename & $fFile, "-> " & $variable & "  =" & $variable)
        ; Openinglog file with notepad
    EndIf
        Global $01path  = "M:\01_INSTALLATION_POSTE\Logiciels_13-02-2019\" ;le chemin
        Dim $Array [13] = ["01_googlechromestandaloneenterprise64.msi", _    ; 0 Google
    "02_Firefox Setup .0.1.exe", _                                         ; 1 Firefox
    "03_install_flash_player__active_x.msi", _                             ; 2 Flash active
    "03_install_flash_player_32_plugin.msi", _                             ; 3 Flash plugin
    "04_AdobeAIRInstaller.exe", _                                        ; 4 Adobe
    "05_sw_lic_full_installer.msi", _                                     ; 5 Shockwave
    "06_jre-8u201-windows-x64.exe", _                                     ; 6 Java
    "07_AcroRdrDC1901020091_fr_FR.exe" , _                                 ; 7 Acrordr
    "08_winrar-x64-561fr.exe", _                                         ; 8 Winrar
    "09_7z1806-x64.exe", _                                                 ; 9 Zip
    "10_gimp-2.10.8-setup-2.exe", _                                     ; 10 Gimp
    "11_vlc-3.0.6-win64.exe" , _                                         ; 11 Vlc
    "12_LibreOffice_6.1.5_Win_x64.msi"]                                 ; 12 Libreoffice
            For $i = 0 To 13 - 1
        Sleep (1000)
        if FileExists($01path & $Array[$i]) Then; test all the paths of the array (var $ i)
            TrayTip("all", "ok", 10000, $TIP_ICONASTERISK)
            else
            TrayTip("/! \ Problem", "one of the software names is not good", 10000, $TIP_ICONASTERISK); says if he has 1 fault
        EndIf
        Next

thank again 

image.png

Share this post


Link to post
Share on other sites

i don't know why don't fishing log pepole can help me i have tested whit

#include <file.au3>
Global $LogFile = @ScriptDir & "\MonLog.log"
If FileExists($LogFile) Then FileDelete($LogFile)
    _FileWriteLog($LogFile,"Text 1") ; Par defaut ajouté à la fin
_FileWriteLog($LogFile,"Text 2") ; Par defaut ajouté à la fin
    _FileWriteLog($LogFile,"Cette ligne est rajoutée au début", 1)
_FileWriteLog($LogFile,"Cette ligne est rajoutée au encore au début", 1)
    _FileWriteLog($LogFile,"Text 3", -1) ; -1 est la valeur par defaut (ajoute à la fin)
_FileWriteLog($LogFile,"Text 4", -1) ; -1 est la valeur par defaut (ajoute à la fin)

need see logs and a lot other code and never good or ne obligate logs 

Message of orreur 

i me loop ex software 2 not good me code give me "software 2 faulse" , software 5 is good me code dont give me is good becose i don't need information me code give me software faulse for speed for me and swap speed and need lose time whit that probleme 

You see ? or not call 

thank you all for help 

 

Share this post


Link to post
Share on other sites

hey all i have change code 

 

Frensh dude give me the code 

i give you frensh forum : https://www.autoitscript.fr/forum/viewtopic.php?f=3&t=15092&p=103419#p103419

 

#include <File.au3>
#include <Array.au3>
;============================================ mise en place de sous dossiers et de fichiers pour l'exemple =======================================================
;                                             en réalité, c'est à faire manuellement
DirCreate(@ScriptDir & "\Programmes")
Local $sousdossiers[13] =["Gimp","Firefox","Chrome","PaintNet","AutoIt","Scite","NotePad","VLC","MultiMedia","machin","Bidule","Truc","Autre"]
For $i = 0 To 12
        DirCreate(@ScriptDir & "\Programmes\" & $sousdossiers[$i])
        $open = FileOpen(@ScriptDir & "\Programmes\" & $sousdossiers[$i] &"\"& $sousdossiers[$i]&"-"& $i&"."& $i + 2&".exe",8 + 2)
        FileClose($open)
Next
;=======================================================================================================================================================
;Le but est de surveiller le dossier Programmes et de réécrire l'ini. Les chemins seront mis à jour à chaque lancement
; on cherche les Exe dans les sous dossiers de Programmes
FileDelete(@ScriptDir & "\monIni.ini");on détruit l'ini
$aArray = _FileListToArrayRec(@ScriptDir & "\Programmes", "*.exe;*.msi", $FLTAR_FILESFOLDERS ,$FLTAR_RECUR,$FLTAR_SORT   , $FLTAR_FULLPATH)
_ArrayDisplay($aArray)
Local $key, $iValue
For $i = 1 To $aArray[0]
        If StringRight($aArray[$i], 3) = "exe" Or   StringRight($aArray[$i], 3) = "msi" Then;si la ligne se termine par "exe" ou "msi"
                $iValue = $aArray[$i] ;enregistre le chemin
        Else
                $split = StringSplit($aArray[$i],"\");on découpe le chemin du sous dossier
                $key = $split[UBound($split) - 1]; enregistre le nom du sous dossier
        EndIf

        If $key > "" And $iValue > "" And StringInStr($iValue,$key) > 0 Then;(Key=Value) si la clef et sa valeur ne sont pas vide et si le nom de la clef se retrouve dans sa valeur
                IniWrite(@ScriptDir & "\monIni.ini","command", $key, $iValue)   ;on écrit
                $key = "" ;on vide les variables pour la prochaine ligne
                $iValue = ""
        EndIf

Next

ShellExecuteWait(@ScriptDir & "\monIni.ini")
$aArray_ini = IniReadSection(@ScriptDir & "\monIni.ini","command")
_ArrayDisplay($aArray_ini)
;à partir de ce tableau, on peut nommer par exemple un bouton avec $aArray_ini[1][0] et pour son action ShellExecute($aArray_ini[1][1]) (AutoIt dans le cas présent)
 

i is good juste it tells me that my file "MonIni.ini" does not exist i don't know why

thank for help 

---------------Détecter la langueAfrikaansAlbanaisAllemandAmhariqueAnglaisArabeArménienAzériBasqueBengaliBiélorusseBirmanBosniaqueBulgareCatalanCebuanoChewaChinois (simplifié)Chinois (traditionnel)CingalaisCoréenCorseCréole haïtienCroateDanoisEspagnolEspérantoEstonienFinnoisFrançaisFrison occidentalGaélique écossaisGalicienGalloisGéorgienGoudjeratiGrecHaoussaHawaïenHébreuHindiHmongHongroisIgboIndonésienIrlandaisIslandaisItalienJaponaisJavanaisKannadaKazakhKhmerKirghizeKurdeLaoLatinLettonLituanienLuxembourgeoisMacédonienMalaisMalayalamMalgacheMaltaisMaoriMarathiMongolNéerlandaisNépalaisNorvégienOurdouOuzbekPachtoPendjabiPersanPolonaisPortugaisRoumainRusseSamoanSerbeShonaSindhiSlovaqueSlovèneSomaliSotho du SudSoundanaisSuédoisSwahiliTadjikTagalogTamoulTchèqueTélougouThaïTurcUkrainienVietnamienXhosaYiddishYorubaZoulouFrançais
 
 

 

 
Edited by dozosama

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...