Found a really simple solution to using NoVarsInStrings along with the Execute function that does not depend on the state of NoVarsInStrings - This example is how I fixed the WMIExec function.

Code:
 
Dim $Dollar, $exCmd ...
$Dollar = Chr(36)

$exCmd = $Dollar + "sValue = " + $Dollar + "objInstance." + $sWhat
$ = Execute($exCmd)


As you can see, the $exCmd string is built using the $Dollar value (outside strings) preceeding the name of any variable that must be referenced by the Execute function. It also pre-references the $sWhat, inserting the value into the statement, rather than letting the Execute statement reference it.

I've tested this mod with both NoVarsInStrings settings and it works either way. It's a bit long, but it eliminates all the logic and preparatory code.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D