Jump to content

Exe is not running when passes any arguements


Kris123
 Share

Recommended Posts

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 by Juvigy
Link to comment
Share on other sites

You have to insert some spaces:

Run($AutoItexePath & "\AutoIt3.exe " & @ScriptDir & "\Hai.au3 10 20 30")
Edited 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 - 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 (NEW 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

 

Link to comment
Share on other sites

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

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 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 - 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 (NEW 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

 

Link to comment
Share on other sites

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

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 by Kris123
Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...