Kris123 Posted October 14, 2009 Posted October 14, 2009 (edited) Dear all, i am sending arguements to my exe from my main script. But exe is not executing. Please help me out. Main script code Run( '"' & $AutoItexePath & '\AutoIt3.exe' & @ScriptDir & "\Hai.au3" & "10" & ' ' & "20" & ' ' & "30") my exe code msgbox(64, "Hello", $CmdLine[0]) Edited October 14, 2009 by Kris123
Juvigy Posted October 14, 2009 Posted October 14, 2009 (edited) I think you need to add spaces between your script name and the parameters. Run( '"' & $AutoItexePath & '\AutoIt3.exe' & @ScriptDir & "\Hai.au3" & "10" & ' ' & "20" & ' ' & "30") this should be Run( '"' & $AutoItexePath & '\AutoIt3.exe' & @ScriptDir & "\Hai.au3 10 20 30") Edited October 14, 2009 by Juvigy
water Posted October 14, 2009 Posted October 14, 2009 (edited) You have to insert some spaces: Run($AutoItexePath & "\AutoIt3.exe " & @ScriptDir & "\Hai.au3 10 20 30") Edited October 14, 2009 by water My UDFs and Tutorials: Spoiler 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
Kris123 Posted October 14, 2009 Author Posted October 14, 2009 In my main code i am putting these statements. $AutoItProdexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir");installDir for production $AutoItBetaexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","betaInstallDir");installDir for production $AutoItexePath = $AutoItProdexePath;default to beta??
water Posted October 14, 2009 Posted October 14, 2009 (edited) Are there any spaces in your $AutoItexePath or the @ScriptDir? EDIT: I tried with spaces in the $AutoItexePath and it still works. Could you please post your complete code you are running now? Edited October 14, 2009 by water My UDFs and Tutorials: Spoiler 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
martin Posted October 14, 2009 Posted October 14, 2009 In my main code i am putting these statements. $AutoItProdexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir");installDir for production $AutoItBetaexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","betaInstallDir");installDir for production $AutoItexePath = $AutoItProdexePath;default to beta?? If that is taken from where I think it is then you will see how Run is used a little further on in the script which might help. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Kris123 Posted October 15, 2009 Author Posted October 15, 2009 (edited) Hi water my code is that only. i don't have anything other than that. i trying this for some other purpose. If it is works out , then i will try to implement. Main script: $AutoItProdexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir");installDir for production $AutoItBetaexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","betaInstallDir");installDir for production $AutoItexePath = $AutoItProdexePath;default to beta?? Run( '"' & $AutoItexePath & '\AutoIt3.exe' & @ScriptDir & "\Hai.au3 10 20 30") Exe Script : msgbox(64, "Hello", "Hai I am in exe") msgbox(64, "Hello", $CmdLine[2]) Please help me. Edited October 15, 2009 by Kris123
Juvigy Posted October 15, 2009 Posted October 15, 2009 I think you dont understand how this works. Let me illustrate that: Create a script with only one line : msgbox(64,"Number of parameters:"&$CmdLine[0], "Value of parameter number 2:"&$CmdLine[2]) Compile it to Command.exe and save it to c:\ Then open start menu>Run and type CMD > press OK In the CMD window type: 1. cd\ 2. command 10 20 30 40 50 The above line will start your newly created Command.exe with the 10 20 30 40 50 parameters.
martin Posted October 15, 2009 Posted October 15, 2009 Hi water my code is that only. i don't have anything other than that. i trying this for some other purpose. If it is works out , then i will try to implement. Main script: $AutoItProdexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir");installDir for production $AutoItBetaexePath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","betaInstallDir");installDir for production $AutoItexePath = $AutoItProdexePath;default to beta?? Run( '"' & $AutoItexePath & '\AutoIt3.exe' & @ScriptDir & "\Hai.au3 10 20 30") Exe Script : msgbox(64, "Hello", "Hai I am in exe") msgbox(64, "Hello", $CmdLine[2]) Please help me. If you make the string for the Run parameter into a variable and print it out using ConsoleWrite you can usually see what is wrong. $torun = '"' & $AutoItexePath & '\AutoIt3.exe' & @ScriptDir & "\Hai.au3 10 20 30" consolewrite($torun & @CRLF) You need to put some thought into what that string is; you have an unbalanced quotation mark for example, no space between the exe and the @ScriptDir, no quotation marks around the script to run; it's a bit of a mess Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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