Kris123 Posted October 14, 2009 Share 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 Link to comment Share on other sites More sharing options...
Juvigy Posted October 14, 2009 Share 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 Link to comment Share on other sites More sharing options...
water Posted October 14, 2009 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Kris123 Posted October 14, 2009 Author Share Posted October 14, 2009 No yar it is still not working Link to comment Share on other sites More sharing options...
Kris123 Posted October 14, 2009 Author Share 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?? Link to comment Share on other sites More sharing options...
water Posted October 14, 2009 Share 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
martin Posted October 14, 2009 Share 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. Link to comment Share on other sites More sharing options...
Kris123 Posted October 15, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
Juvigy Posted October 15, 2009 Share 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. Link to comment Share on other sites More sharing options...
martin Posted October 15, 2009 Share 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. 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