"RunWait": complex concatenating
Posted: 27 May 2019, 12:42
have a command call, at the moment called via a BAT / CMD file. It starts an EXE with a (long) parameter and writes the output to a log-file (>> command).
It looks like this
"C:\Program Files\Autodesk\AutoCAD 2018\Map\bin\IMBatch.exe" ConfigFile= x:\my test\data\1-klick_wartung_vlwa.xml >> results_vlwa.log
Now I want to
- replace the BAT with a "Runas" from AHK (The GUI and all that stuff is already done)
- use a part of the string as variable because of multiple usage of the Runas
So I want to do this (not working fake code):
myvalue = vlwa
RunWait, "C:\Program Files\Autodesk\AutoCAD 2018\Map\bin\IMBatch.exe" ConfigFile= x:\my test\data\1-klick_wartung_%myvalue%.xml >> %A_ScriptDir%\results_%myvalue%.log
myvalue = foo
runwait, ....
But I have problems to get the right string - due to the collection of (multiple?) quotes, blanks, = and > and AHK-variables.
(Question for advanced: Is it a good idea to keep the output with the CMD commands ">>"? Or is there an AHK output-handling?)
I'm happy if someone can help me with that.
Peter
It looks like this
"C:\Program Files\Autodesk\AutoCAD 2018\Map\bin\IMBatch.exe" ConfigFile= x:\my test\data\1-klick_wartung_vlwa.xml >> results_vlwa.log
Now I want to
- replace the BAT with a "Runas" from AHK (The GUI and all that stuff is already done)
- use a part of the string as variable because of multiple usage of the Runas
So I want to do this (not working fake code):
myvalue = vlwa
RunWait, "C:\Program Files\Autodesk\AutoCAD 2018\Map\bin\IMBatch.exe" ConfigFile= x:\my test\data\1-klick_wartung_%myvalue%.xml >> %A_ScriptDir%\results_%myvalue%.log
myvalue = foo
runwait, ....
But I have problems to get the right string - due to the collection of (multiple?) quotes, blanks, = and > and AHK-variables.
(Question for advanced: Is it a good idea to keep the output with the CMD commands ">>"? Or is there an AHK output-handling?)
I'm happy if someone can help me with that.
Peter