Jump to content
Sign in to follow this  

Error Passing Arguments to Compiled Script

Recommended Posts


I've searched these forums and read the help article: http://www.autoitscript.com/autoit3/docs/intro/running.htm#CommandLine and I can't find a clear answer to this.

Why do I receive the error "Line -1: Error: Incorrect number of parameters in function call" when I pass two parameters to a script in the the command line: "compiledscript.exe Test1 Test33"?


$sParam1 = $CmdLine[1]

$sParam2 = $CmdLine[2]

MsgBox($sParam1 & " " & $sParam2)

Do I have to call $CmdLine from a function? Can I not pass parameters to variables within my script? I am clearly passing two arguments to a script that is expecting two arguments.

Share this post

Link to post
Share on other sites

your msgbox() is missing parameters.

Its easier to debug these type of issues when you use the Full SciTE4AutoIt3 package which would run au3check and report these type of problems.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.