Since you already are evaluating relevance, no need for the brackets inside the {}…
Try this:
if {exists file (“C:” & computer name & “_HKLM.hiv”)}
delete "C:{Computer name}_HKLM.hiv"
dos reg save HKLM "C:{Computer name}_HKLM.hiv"
else
dos reg save HKLM "C:{Computer name}_HKLM.hiv"
endif
You might also just use the relevance for the Task:
exists file (“C:” & computer name & “_HKLM.hiv”)
And then you don’t need to bother with the if statement (it will only run on computers where the file exists…