disable auto quoting when using variable substitution on batch scripts. Fixes
@@ -201,7 +201,12 @@ class Script(BaseAuditModel):
if match:
# only get the match between the () in regex
string = match.group(1)
- value = replace_db_values(string=string, instance=agent, shell=shell)
+ value = replace_db_values(
+ string=string,
+ instance=agent,
+ shell=shell,
+ quotes=True if shell != ScriptShell.CMD else False,
+ )
if value:
temp_args.append(re.sub("\\{\\{.*\\}\\}", value, arg))
