- Mes inputs (sous forme de variables, destinée à remplir le batch de copie) ne me retournent que des chiffres, commençant par 25, puis augmentant de 1 à chaque input. Résolu.
- J'ai maintenant un second soucis : J'avais intégré deux "if" sur plusieurs lignes dans mon script, mais quand je réduisais la fonction, SCiTE la fermais avant le "Then" du "if". AutoIT me donnait donc une erreur "multi-line 'If' missing 'Then'.". Et comme la mention "multiline" n'est pas tombé dans l'oeil d'un aveugle, j'ai essayé de mettre mon if sur une ligne, mais AutoIT me sors "'If' must have an 'Then' statement".
Petit spoiler du script :
► Afficher le texteLa fonction en cause
Func OKClick()
$content = ""
Global $BatLoc = FileSaveDialog("Enregistrer sous", @ScriptDir, "Batch File (*.bat)", 16, "FKCopy.bat")
$content &="@echo off" & @CRLF
$content &="title FramaKey Duplication System - FKCopy" & @CRLF
$content &="color 0a" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo G‚n‚ration du batch..." & @CRLF
$content &="echo Batch g‚n‚r‚" & @CRLF
$content &="echo Appuyez sur Entr‚e pour formater les cl‚s" & @CRLF
$content &="pause" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="format "& GUICtrlRead ($K1)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K2)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K3)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K4)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K5)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K6)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K7)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K8)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K9)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K10)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K11)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K12)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K13)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K14)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K15)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K16)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K17)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K18)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K19)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K20)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Appuyez sur Entr‚e pour copier les fichiers Framakey" & @CRLF
$content &="pause" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Copie des fichiers" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K1)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K2)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K3)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K4)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K5)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K6)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K7)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K8)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K9)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K10)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K11)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K12)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K13)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K14)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K15)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K16)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K17)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K18)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K19)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K20)&": /MIR" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Copie termin‚e" & @CRLF
$content &="echo Cl,(s) pr^tes !" & @CRLF
$content &="echo Appuyez sur une touche pour fermer..." & @CRLF
$content &="pause" & @CRLF
$batch_file = FileOpen($BatLoc, 2)
FileWrite($batch_file, $content)
FileClose($batch_file)
Sleep (1)
MsgBox (64, "Info", "Maintenant, vous pouvez lancer FKCopy.bat, ou le garder dans un coin pour l'utiliser après (Obligatoirement sur le même PC)." & @CRLF & "Pensez bien à sauvegarder ailleur le fichier FKCopy.bat, car il sera supprimé dès la fermeture du programme")
Sleep (1)
Version mutligne :
If WinExists ("FramaKey Duplication System - FKCopy")
_GUICtrlStatusBar_SetText($Status, "En cours de copie")
Then
_GUICtrlStatusBar_SetText($Status, "Pensez bien à sauvegarder le fichier ailleur.")
EndIf
Version une ligne :
If WinExists ("FramaKey Duplication System - FKCopy") _GUICtrlStatusBar_SetText($Status, "En cours de copie")
Then _GUICtrlStatusBar_SetText($Status, "Pensez bien à sauvegarder le fichier ailleur.") EndIf
EndFunc
$content = ""
Global $BatLoc = FileSaveDialog("Enregistrer sous", @ScriptDir, "Batch File (*.bat)", 16, "FKCopy.bat")
$content &="@echo off" & @CRLF
$content &="title FramaKey Duplication System - FKCopy" & @CRLF
$content &="color 0a" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo G‚n‚ration du batch..." & @CRLF
$content &="echo Batch g‚n‚r‚" & @CRLF
$content &="echo Appuyez sur Entr‚e pour formater les cl‚s" & @CRLF
$content &="pause" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="format "& GUICtrlRead ($K1)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K2)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K3)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K4)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K5)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K6)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K7)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K8)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K9)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K10)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K11)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K12)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K13)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K14)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K15)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K16)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K17)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K18)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K19)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="format "& GUICtrlRead ($K20)&": /v:"& GUICtrlRead ($FramaName)&" /Q /fs:FAT32" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Appuyez sur Entr‚e pour copier les fichiers Framakey" & @CRLF
$content &="pause" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Copie des fichiers" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K1)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K2)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K3)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K4)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K5)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K6)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K7)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K8)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K9)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K10)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K11)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K12)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K13)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K14)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K15)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K16)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K17)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K18)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K19)&": /MIR" & @CRLF
$content &="robocopy "& GUICtrlRead ($SourceKey)&" "& GUICtrlRead ($K20)&": /MIR" & @CRLF
$content &="cls" & @CRLF
$content &="echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ºCopieur de cl‚(s) USB Framakeyº" & @CRLF
$content &="echo º º" & @CRLF
$content &="echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ" & @CRLF
$content &="echo Copie termin‚e" & @CRLF
$content &="echo Cl,(s) pr^tes !" & @CRLF
$content &="echo Appuyez sur une touche pour fermer..." & @CRLF
$content &="pause" & @CRLF
$batch_file = FileOpen($BatLoc, 2)
FileWrite($batch_file, $content)
FileClose($batch_file)
Sleep (1)
MsgBox (64, "Info", "Maintenant, vous pouvez lancer FKCopy.bat, ou le garder dans un coin pour l'utiliser après (Obligatoirement sur le même PC)." & @CRLF & "Pensez bien à sauvegarder ailleur le fichier FKCopy.bat, car il sera supprimé dès la fermeture du programme")
Sleep (1)
Version mutligne :
If WinExists ("FramaKey Duplication System - FKCopy")
_GUICtrlStatusBar_SetText($Status, "En cours de copie")
Then
_GUICtrlStatusBar_SetText($Status, "Pensez bien à sauvegarder le fichier ailleur.")
EndIf
Version une ligne :
If WinExists ("FramaKey Duplication System - FKCopy") _GUICtrlStatusBar_SetText($Status, "En cours de copie")
Then _GUICtrlStatusBar_SetText($Status, "Pensez bien à sauvegarder le fichier ailleur.") EndIf
EndFunc
Merci d'avance




