This should be relatively straight forward, but I'm drawing a blank.
I'm trying to execute some dynamic code in vbscript from a variable, but I can't seem to get it right:
Sub subAddDic(strDicObj, strDicKey, strDicValue)
If strDicObj <> "" And strDicKey <> "" And strDicValue <> "" Then
Set WshShell = CreateObject("WScript.Shell")
strAddCmd = _
"If Not " & strDicObj & ".Exists(" & fncQuote(strDicKey) & ") Then" & vbCrLf & _
strDicObj & ".Add " & fncQuote(strDicKey) & " " & fncQuote(strDicValue) & vbCrLf & _
Set WshShell = Nothing
If strData <> "" Then
fncQuote = Chr(34) & strData & Chr(34)
fncQuote = ""
I'm erroring on this line "WshShell.Run(strAddCmd)" - where it's attempting to look for a file on the filesystem, and tells me that it's not found.
Anyone know how I can execute the inline variable as just vbs?