peut on insérer du batch dans autoit ?
Posté : jeu. 29 juil. 2021 16:28
Bonjour,
Je souhaite faire un lanceur avec des checkboxs, pour remplacer un vieux .bat qui demandait pour tous les logiciels si oui ou non on voulait l'installer. J'ai parcouru le forum j'ai pu faire ceci :
pour notre powerpoint c'est assez simple puisque c'est qu'une ligne de batch. Je suppose que je peux le lancer avec un runwait. Mais lorsque l'installation demande plusieurs ligne, comment je dois faire ? est ce que je dois forcement isoler le code dans un autre .bat ? ou il y a un autre moyen ?
J'aimerai voir l'invite de commande, ou plutot ce qu'il s'y passe à l’intérieur. Peut on intégrer ça a auto it ? dans un textarea par exemple ?
Je souhaite faire un lanceur avec des checkboxs, pour remplacer un vieux .bat qui demandait pour tous les logiciels si oui ou non on voulait l'installer. J'ai parcouru le forum j'ai pu faire ceci :
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 361, 345, 299, 210)
Global $Group1 = GUICtrlCreateGroup("Logiciels", 80, 48, 201, 265)
Global $CHK_powerpoint = GUICtrlCreateCheckbox("Powerpoint OneNote ", 120, 88, 129, 25)
Global $CHK_notepad = GUICtrlCreateCheckbox("notepad", 120, 120, 97, 17)
Global $CHK_filezilla = GUICtrlCreateCheckbox("Filezilla", 120, 152, 97, 17)
Global $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 120, 184, 97, 17)
Global $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 120, 216, 97, 17)
Global $BTN_installer = GUICtrlCreateButton("Installer", 144, 256, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $BTN_installer
_DoInstallation()
EndSwitch
WEnd
Func _DoInstallation()
If GUICtrlRead($CHK_powerpoint)=$GUI_CHECKED Then
RunWait(@COMSPEC & " /k \\serveur\powerpoint\install.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=C:\installpower.txt")
Sleep(500)
EndIf
If GUICtrlRead($CHK_notepad)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallNotepad.bat //b" )
Sleep(500)
EndIf
If GUICtrlRead($CHK_filezilla)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallFilezilla.bat //b" )
Sleep(500)
EndIf
EndFunc
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 361, 345, 299, 210)
Global $Group1 = GUICtrlCreateGroup("Logiciels", 80, 48, 201, 265)
Global $CHK_powerpoint = GUICtrlCreateCheckbox("Powerpoint OneNote ", 120, 88, 129, 25)
Global $CHK_notepad = GUICtrlCreateCheckbox("notepad", 120, 120, 97, 17)
Global $CHK_filezilla = GUICtrlCreateCheckbox("Filezilla", 120, 152, 97, 17)
Global $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 120, 184, 97, 17)
Global $Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 120, 216, 97, 17)
Global $BTN_installer = GUICtrlCreateButton("Installer", 144, 256, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $BTN_installer
_DoInstallation()
EndSwitch
WEnd
Func _DoInstallation()
If GUICtrlRead($CHK_powerpoint)=$GUI_CHECKED Then
RunWait(@COMSPEC & " /k \\serveur\powerpoint\install.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=C:\installpower.txt")
Sleep(500)
EndIf
If GUICtrlRead($CHK_notepad)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallNotepad.bat //b" )
Sleep(500)
EndIf
If GUICtrlRead($CHK_filezilla)=$GUI_CHECKED Then
RunAswait ( "admin", "MonDomaine", "MonPWD", 0, "cscript \\LeServeur\Appli\InstallFilezilla.bat //b" )
Sleep(500)
EndIf
EndFunc
J'aimerai voir l'invite de commande, ou plutot ce qu'il s'y passe à l’intérieur. Peut on intégrer ça a auto it ? dans un textarea par exemple ?