rich2323 Posted November 26, 2009 Posted November 26, 2009 I am trying to read an autoit command from an ini file then execute the command that was read. Example: test.ini file: [Run] pv_run1 = msgbox(0,"testing","testing") test.au3 file: $run1 = IniRead ( "test.ini", "run", "pv_run1", "nothing" ) I want to run the command $run1 so it will display a message box. I have not been able to do this. Does anyone have any suggestions? Is this possible? Thanks, Rich
99ojo Posted November 26, 2009 Posted November 26, 2009 (edited) Hi, just add: 1) Change ini to: [Run] pv_run1 = msgbox(0,'testing','testing') 2) $run1 = IniRead ( "test.ini", "run", "pv_run1", "nothing" ) $cmd = " /AutoIt3ExecuteLine " & Chr (34) & $run1 & Chr (34) Run(@AutoItExe & $cmd) or more elegant: _executeAutoITcmd (IniRead ( "test.ini", "run", "pv_run1", "nothing" )) Func _executeAutoITcmd ($run) $cmd = " /AutoIt3ExecuteLine " & Chr (34) & $run & Chr (34) Run(@AutoItExe & $cmd) EndFunc ;-)) Stefan Edited November 26, 2009 by 99ojo
rich2323 Posted November 26, 2009 Author Posted November 26, 2009 That worked thank you!! I am guess that the "Chr (34)" is a space. Thanks again! Rich
99ojo Posted November 26, 2009 Posted November 26, 2009 (edited) I am guess that the "Chr (34)" is a space.No, it is " See helpfile Running Scripts: Form4: AutoIt3.exe [/ErrorStdOut] /AutoIt3ExecuteLine "command line" Execute one line of code. ;-)) Stefan Edited November 26, 2009 by 99ojo
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