Hemrry Posted June 20, 2023 Posted June 20, 2023 (edited) I want to make a code to automatically execute the installation of certain programs, it's almost ready, only that when executing the installation the CMD sales are shown and I want them to be hidden and I've already tried many options in forums but they don't work for me I don't have Any idea that I may be doing wrong, could you help me please? expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <SendMessage.au3> #RequireAdmin Global $FileChrome = Global $FileAdobe = Global $FileDropbox = Global $FileOffice = Global $FileIso = UltraISO\UltraISO.exe /? Dim $Ini, $fin, $VPinc, $Progress1 IniA () Func IniA () $VPinc = GUICreate("Instalacion de Programas", 401, 437, -1, -1) GUISetBkColor(0x000000) $Ini = GUICtrlCreateButton("Instalar Programas", 100, 16, 200, 30, $BS_MULTILINE) GUICtrlSetFont(-1, 12, 800, 2, "Times New Roman") GUICtrlSetCursor (-1, 0) $Label2 = GUICtrlCreateLabel("Precione ESC para Salir", 120, 399, 160, 22) GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman") GUICtrlSetColor(-1, 0x34EB41) $Label1 = GUICtrlCreateLabel("Google Chrome", 16, 72, 112, 22) GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman") GUICtrlSetColor(-1, 0x34EB41) $Label3 = GUICtrlCreateLabel("Adobe Acrobat DC", 16, 102, 128, 22) GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman") GUICtrlSetColor(-1, 0x34EB41) $Label4 = GUICtrlCreateLabel("Dropbox", 16, 132, 64, 22) GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman") GUICtrlSetColor(-1, 0x34EB41) $Label5 = GUICtrlCreateLabel("Microsoft Office 2013", 16, 162, 144, 22) GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman") GUICtrlSetColor(-1, 0x34EB41) $Label6 = GUICtrlCreateLabel("Ultra ISO", 16, 192, 72, 22) GUICtrlSetFont(-1, 11, 800, 2, "Times New Roman") GUICtrlSetColor(-1, 0x34EB41) $Progress1 = GUICtrlCreateProgress(32, 360, 337, 25) GUICtrlSetColor(-1, 0x008000) GUICtrlSetBkColor(-1, 0xFFFFFF) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Ini RunWait('"' & @ComSpec & ' /c "' & $FileChrome & '"', @SW_HIDE) _SendMessage(GUICtrlGetHandle($Progress1), 20) Sleep (100) GUICtrlSetData(-1, 20) RunWait('"' & @ComSpec & ' /c "' & $FileAdobe & '"', @SW_HIDE) _SendMessage(GUICtrlGetHandle($Progress1), 40) Sleep (100) GUICtrlSetData(-1, 40) RunWait('"' & @ComSpec & ' /c "' & $FileDropbox & '"', @SW_HIDE) _SendMessage(GUICtrlGetHandle($Progress1), 60) Sleep (100) GUICtrlSetData(-1, 60) RunWait('"' & @ComSpec & ' /c "' & $FileOffice & '"', @SW_HIDE) _SendMessage(GUICtrlGetHandle($Progress1), 80) Sleep (100) GUICtrlSetData(-1, 80) RunWait('"' & @ComSpec & ' /c "' & $FileIso & '"', @SW_HIDE) _SendMessage(GUICtrlGetHandle($Progress1), 100) Sleep (100) GUICtrlSetData(-1, 100) GUISetState(@SW_SHOW,$VPinc) EndSwitch WEnd EndFunc Edited June 20, 2023 by Hemrry
Developers Jos Posted June 20, 2023 Developers Posted June 20, 2023 6 hours ago, Hemrry said: Global $FileIso = UltraISO\UltraISO.exe /? This code won't run ...right? Normally one would use the silent install option of the product installer which often is /S SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Hemrry Posted June 20, 2023 Author Posted June 20, 2023 8 minutes ago, Jos said: Este código no se ejecutará ... ¿Derecha? Normalmente se usaría la opción de instalación silenciosa del instalador del producto, que a menudo es /S Thank you very much, yes I know, I just put it like this to have it as a test and see the execution window
Developers Jos Posted June 20, 2023 Developers Posted June 20, 2023 Then I am lost on what you are asking us... maybe you can try to explain when you want to see and what you want to suppress? PS: Please do not add an other language quotes in your answers and stick to English only. Also only quote text when it would else be unclear what you are responding to, else just port the response only. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Hemrry Posted June 20, 2023 Author Posted June 20, 2023 Ok, the only thing I don't want is for the cmd window to not be displayed when running UltraISO\UltraISO.exe /s , when the While is executed, all cmd windows are displayed even though I'm set @SW_HIDE to hide the sale that's what I mean and excuse me
Nine Posted June 20, 2023 Posted June 20, 2023 @SW_HIDE should be third parameter, not second. The second param is the working directory... Please refer to help file. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Hemrry Posted June 20, 2023 Author Posted June 20, 2023 (edited) Sorry, I don't know if I'm doing it wrong but I already tried anyway and it still shows the cmd window for like 1 second and it disappears Edited June 20, 2023 by Hemrry
Solution Nine Posted June 20, 2023 Solution Posted June 20, 2023 Listen well, this is basic stuff, you need to be able to solve this simple problem by yourself. Reduce your script to the bare minimum to reproduce the problem. Add some error handling and log every line of your script. If after all you cannot solve it on your own, then post something that everyone can run. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now