joesedroid Posted November 13, 2015 Posted November 13, 2015 Hello, I looked around but could not find an answer to this, it may be that its too simple. But I am trying to create an executable from a simple 10 line batch file.When I use autoit to do it I get the attached error.Any Ideas?Thanks Joe
Moderators Melba23 Posted November 13, 2015 Moderators Posted November 13, 2015 joesedroid,Welcome to the AutoIt forums.You cannot use AutoIt to convert a batch file to an executable - the file to convert needs to be a working AutoIt script. But you can probably get AutoIt to do whatever the batch file does - and then you will be able to make an executable. So I suggest you post the batch file (see here how to do it) and then we can see how you might proceed.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: Reveal hidden contents 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
joesedroid Posted November 13, 2015 Author Posted November 13, 2015 slmgr.vbs /ipk xxxx-xxxx-xxxx-xxxx-xxx-xxxx slmgr.vbs /skms Server.org.location slmgr.vbs /ato cd "c:\program files (x86)\Microsoft Office\Office14" cscript ospp.vbs /sethst:Server.org.location cscript ospp.vbs /act slmgr.vbs /dli cscript ospp.vbs/dhistorykms=============================Excellent, thanks for getting back to me, I am just trying to activate licenses for office.Hope this works.
water Posted November 13, 2015 Posted November 13, 2015 Welcome to Autoit and the forum!What do you want to do with the output of slmgr.vbs etc? Retrieve the output and check for errors?If I start it from the command line I get a MsgBox. My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Trong Posted November 13, 2015 Posted November 13, 2015 RunWait(@ComSpec & " /c "&"slmgr.vbs /ipk xxxx-xxxx-xxxx-xxxx-xxx-xxxx","",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /skms Server.org.location","",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /ato","",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs /sethst:Server.org.location","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs /act","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /dli","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs/dhistorykms","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) Regards,
joesedroid Posted November 16, 2015 Author Posted November 16, 2015 On 11/13/2015 at 3:49 PM, Trong said: slmgr.vbs (Windows7/2008)Software Licensing Management Tool.This just allows us to point to the KMS key and authenticate it with our KMS server/Microsoft and activate it.The only output we want to see is if it was successful. I tried to use Trongs command but am unsure where to do it. I made it a .txt file and an .au3, says it compiles successfully but nothing happens when I run it.Thanks again for your help. On 11/13/2015 at 3:49 PM, Trong said: RunWait(@ComSpec & " /c "&"slmgr.vbs /ipk xxxx-xxxx-xxxx-xxxx-xxx-xxxx","",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /skms Server.org.location","",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /ato","",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs /sethst:Server.org.location","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs /act","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /dli","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs/dhistorykms","c:\program files (x86)\Microsoft Office\Office14",@SW_HIDE)
water Posted November 16, 2015 Posted November 16, 2015 Nothing happens because the scripts are being run hidden (caused by @SW_HIDE).Option "/dli" displays the license information. What do you want to do with this information? My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
joesedroid Posted November 17, 2015 Author Posted November 17, 2015 On 11/16/2015 at 1:54 PM, joesedroid said: That makes sense however when I run the .exe it creates, I see a paused script in the task bar by the clock and its got a flashing X. Do you think im doing something wrong with it? All im really doing is copying the text to a .au3 file and making it a .exeI have about 4 or 5 similar scripts I want to run silently in my environment and I have not used this product before. All i need is for these batch files to be executables. I guess I don't need the full functionality of AutoIT but it seems like it would be a great product to learn and use.
water Posted November 18, 2015 Posted November 18, 2015 The flashing "X" in the taskbar simply means that you paused the script by clicking on the icon. Unselect the "Script Paused" selection in the context menu and you are fine.If needed you can suppress the taskbar icon. My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
joesedroid Posted November 19, 2015 Author Posted November 19, 2015 Ok but when I run it in the SciTE editor i get this...>Running:(3.3.15.0):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\Activations\autoit\test.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop>Process failed to respond; forcing abrupt termination...>Exit code: 1 Time: 8.876Can you direct me to some good training on this? Like I said this is my 1st attempt at this kind of scripting.Thanks
water Posted November 19, 2015 Posted November 19, 2015 Did you press Ctrl+Break to stop execution? My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
joesedroid Posted November 19, 2015 Author Posted November 19, 2015 On 11/19/2015 at 2:28 PM, water said: Did you press Ctrl+Break to stop execution?Yes thats when I got...>Process failed to respond; forcing abrupt termination...>Exit code: 1 Time: 8.876
water Posted November 19, 2015 Posted November 19, 2015 (edited) That is to be expected:Seems to be the normal message when you kill a script using Ctrl+Break. Edited November 19, 2015 by water My UDFs and Tutorials: Reveal hidden contents UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
joesedroid Posted November 20, 2015 Author Posted November 20, 2015 (edited) Ok, I think I got this now... its mostly working however Im not sure how to path to my office folder, right now I have...RunWait(@ComSpec & " /c "&"cd c:\program files (x86)\Microsoft Office\Office14","",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","",@SW_HIDE) RunWait(@ComSpec & " /c "&"cscript ospp.vbs /act","",@SW_HIDE) RunWait(@ComSpec & " /c "&"slmgr.vbs /dli","",@SW_HIDE)And it is saying path not found or script not found (its going to fast to read). Do I need to have this script all on one line?EDIT: After taking a screen shot its pathing to my local profile to run these scripts I.E. Input error: Cannot find Script file "C:\Users\admin\desktop\ospp.vbs"Looks like its not pointing to the c:\program files (x86)\Microsoft Office\Office14"Again, thanks for all your help, I believe this is the last part of my script. Edited November 20, 2015 by joesedroid
Developers Jos Posted November 20, 2015 Developers Posted November 20, 2015 (edited) try:FileChangeDir("c:\program files (x86)\Microsoft Office\Office14") RunWait(@ComSpec & " /c cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","",@SW_HIDE) RunWait(@ComSpec & " /c cscript ospp.vbs /act","",@SW_HIDE) RunWait(@ComSpec & " /c slmgr.vbs /dli","",@SW_HIDE)... and change the /c to /k in case of issues with one of the commands.Jos Edited November 20, 2015 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.
joesedroid Posted November 23, 2015 Author Posted November 23, 2015 Thanks, that seemed fix some if it, two questions though.1) What does the /c /k do?2) When I run this I get a Windows popup showing that ive activated the key AND the key number. id like to not show that. I guessing thats something in the windows OS. Is there a way to not show it?Thanks!
Developers Jos Posted November 23, 2015 Developers Posted November 23, 2015 1) each dos command has a help function so this is easily figure out by yourself. As a one time favor: Quote C:\>cmd /?Starts a new instance of the Windows command interpreterCMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [ [/C | /K] string]/C Carries out the command specified by string and then terminates/K Carries out the command specified by string but remains2) there is a helpfile that comes with AutoIt3, have you looked at the options for RunWait. As it was a one time favor , no additional pointer are provided here. 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.
joesedroid Posted November 23, 2015 Author Posted November 23, 2015 I guess I asked the wrong question. When this script runs it put up the Key in a window that is waiting for an OK. I tried SW_HIDESW_DISABLESend (enter) keyIs this window something that will need to be manually clicked?ThanksJoe
Developers Jos Posted November 23, 2015 Developers Posted November 23, 2015 Ah ok:there is probably not much you can do to avoid it poping up unless the program supports a alternative to provide the key.You could monitor and hide it asap and then fill in the key with ControlSend().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.
Trong Posted November 24, 2015 Posted November 24, 2015 Run(@ComSpec & ' /k cd\&&cls ', "", @SW_SHOWMAXIMIZED) Local $hWnd = WinWait("[CLASS:cmd]", "", 2) WinActivate($hWnd) Send('cd "c:\program files (x86)\Microsoft Office\Office14"'& "{Enter}") Sleep(500) Send('cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX'& "{Enter}") Sleep(500) Send('cscript ospp.vbs /act'& "{Enter}") Sleep(500) Send('slmgr.vbs /dli'& "{Enter}") Sleep(500) Send("Exit{Enter}") Regards,
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