choward Posted January 30, 2016 Share Posted January 30, 2016 Hi, I have a batch file that installs some programs and changes some registry keys and then asks if everything installed correctly. I want to make a nice GUI for this, I've been looking at .hta files but these all involve pressing a button in a nice GUI that then opens the batch file like normal, basically I want it to embed the batch file in the GUI. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 30, 2016 Developers Share Posted January 30, 2016 Welcome, So what exactly is your question? Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 30, 2016 Author Share Posted January 30, 2016 Basically how do I wrap my batch file in a nice GUI? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 30, 2016 Developers Share Posted January 30, 2016 With Autoit3 you can build the GUI and shell the batch file with Run(). Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 30, 2016 Author Share Posted January 30, 2016 Would that run the batch file in a nice GUI so I can see the output of it in the GUI instead of CMD? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 30, 2016 Developers Share Posted January 30, 2016 It is all possible, Not sure what your batch files does, but you probably don;t even need the batch file but can use AutoIt3 syntax for everything. You are able to shell CUI programs and capture their STDOUT / STDERRR output. Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 30, 2016 Author Share Posted January 30, 2016 It basically sets up a PC after a brand new install of Windows. So installs programs and edits the registry. So it needs to be able to run without installing anything. Link to comment Share on other sites More sharing options...
InunoTaishou Posted January 30, 2016 Share Posted January 30, 2016 Just a question, instead of making a GUI for your batch file, make a program that does the same thing as your batch file? Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 Can do, but I don't know any languages. Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 I can show you the batch file if that would help? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 31, 2016 Moderators Share Posted January 31, 2016 choward, It most certainly would - see here how to do it. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 expandcollapse popup@ECHO off COLOR 1F :START @ECHO Install BRM OEM ... REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v Logo /t REG_SZ /d "C:\Windows\BRM Computers\oem.bmp" /reg:64 /f REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v Manufacturer /t REG_SZ /d "BRM Computers" /reg:64 /f REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportHours /t REG_SZ /d "Mon-Fri 9am-5pm - Sat 9am-4pm" /reg:64 /f REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportPhone /t REG_SZ /d "08712 244129" /reg:64 /f REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation /v SupportURL /t REG_SZ /d "hhtp://www.brmcomputers.co.uk" /reg:64 /f MD "C:\Windows\BRM Computers\" %EXTD% /unzip oem.zip "C:\Windows\BRM Computers\" @ECHO Installing Chocolatey ... @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin @ECHO Installing Google Chrome ... CHOCO install googlechrome -y @ECHO Installing Firefox ... CHOCO install firefox -y @ECHO Installing VLC Media Player ... CHOCO install vlc -y @ECHO Installing 7zip ... CHOCO install 7zip -y @ECHO Installing Flash Player ... CHOCO install flashplayerplugin -y @ECHO Installing Java ... CHOCO install javaruntime -y @ECHO Installing Adobe Reader ... CHOCO install adobereader -y @ECHO Installing Kaspersky Internet Security ... CHOCO install kisbrm -version 16.0.0.614 -y @ECHO Installing Apache OpenOffice ... CHOCO install openoffice -y @ECHO Installing TeamViewer ... CHOCO install teamviewer -y @ECHO Settings taskbar icons ... DEL /F /S /Q /A "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*" REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband /F TASKKILL /f /im explorer.exe START explorer.exe TIMEOUT 5 /NOBREAK DEL /F /S /Q /A "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*" REG DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband /F TASKKILL /f /im explorer.exe START explorer.exe TIMEOUT 5 /NOBREAK SYSPIN "C:\Program Files\Mozilla Firefox\firefox.exe" c:5386 SYSPIN "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" c:5386 SYSPIN "C:\Windows\explorer.exe" c:5386 :QUESTION SET /p ANSWER=Did everything install correctly? (Y/N): IF /i %ANSWER% == Y GOTO YES IF /i %ANSWER% == y GOTO YES IF /i %ANSWER% == Yes GOTO YES IF /i %ANSWER% == yes GOTO YES IF /i %ANSWER% == N GOTO NO IF /i %ANSWER% == n GOTO NO IF /i %ANSWER% == No GOTO NO IF /i %ANSWER% == no GOTO NO GOTO QUESTION :YES EXIT :NO GOTO START GOTO QUESTION Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2016 Developers Share Posted January 31, 2016 Just open SciTE and open/create a file somename.au3. Press F1 and start looking for the following commands (sequence of your batchfile): DirCreate RegWrite() DirCreate() ShellExecuteWait() or RunWait() to run the unzip command you use and possibly the powershell command same for subsequent installs etc Just look at the GUI section of the helpfile to find examples of GuiCtreate and all its possible controls. Post questions when you have tried something and hitting a brick wall. Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 Could you write me an example of some of the commands? Is it literary just the command I change? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2016 Developers Share Posted January 31, 2016 I am not in the "write a script" business, but have no issue helping people that are trying/learning themselves. You have been given some pointers how to start and I am wondering whether you have started with those first steps yet. Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 I have started to rewrite it, although I'm not sure how to add in files like the zips. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2016 Developers Share Posted January 31, 2016 (edited) 41 minutes ago, choward said: I'm not sure how to add in files like the zips. FileInstall() ? Do you really want to add the installers to the Script as you now also shell them from somewhere? Jos Edited January 31, 2016 by Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 I want to compile them into the exe so it's only 1 file I have to copy over each time. Also I couldn't get ShellExecuteWait() or RunWait() to work. I really have no idea what I'm doing. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 31, 2016 Developers Share Posted January 31, 2016 Post your code so we can see what you are doing and give pointers. Jos 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. Link to comment Share on other sites More sharing options...
choward Posted January 31, 2016 Author Share Posted January 31, 2016 DirCreate("C:\Windows\BRM Computers\") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_SZ", "C:\Windows\BRM Computers\oem.bmp") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_SZ", "BRM Computers") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportHours", "REG_SZ", "Mon-Fri 9am-5pm - Sat 9am-4pm") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_SZ", "08712 244129") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_SZ", "http://www.brmcomputers.co.uk") Example() Func Example() Local $iReturn = RunWait(@ComSpec & " /c " & "@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin") MsgBox($MB_SYSTEMMODAL, "", "The return code from CMD was: " & $iReturn) EndFunc Link to comment Share on other sites More sharing options...
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