yucap Posted July 2, 2022 Posted July 2, 2022 Hi all, I'm calling my script from the DOS. When I call the exe, I want to send also a value for a variable of my scrypt... which is the best pratice to follow? Many thanks for all in advance.
abberration Posted July 2, 2022 Posted July 2, 2022 Search the help file for "Command Line Parameters". When you pass a parameter into a script, it will be stored in an array variable $CmdLine. Example, make this .au3 script: #include <Array.au3> _ArrayDisplay($CmdLine) Then run this command from a DOS prompt or create a .bat file: test.au3 -this_is_the_parameter_sent /second_parameter You will get an array that shows the two parameters. From there, you can write code to use $CmdLine[0] to check if any parameters have been sent, and if any have been sent, $CmdLine[1] will be the first. If any others were sent, they will be the same, but with a 2, 3, 4, etc. All clear? Easy MP3 | Software Installer | Password Manager
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