I am trying to use the if statement to see if a file exists two different file names. I check with the debugger and all statements return that the action completed successfully. Running the action against a server that has one of the files fails. Below is the action. I am not sure where the failure is taking place as the action fails but reviewing the failure all actions completed. Thank for any help.
// Enter your action script here
action uses wow64 redirection false
if {exists “C:\windows\system32\mrt-kb890830.exe”}
delete "C:\windows\system32\MRT-KB890830.exe"
else
if {exists “c:\windows\system32\mrt.exe”}
delete "C:\windows\system32\mrt.exe"
endif
The ‘action uses wow64 redirection false’ I think only applies to the spawned processes and commands, the actual relevance substitutions still need to handle the redirection. So I think we should use ‘native files’ rather than ‘files’ inspectors…
But I’m still unsure whey we only want to delete one or the other, if you really want it gone, just delete them; the ‘delete’ statement will silently succeed if the file you want to delete is not present
This actually deletes the MRT-KB890830 but will come back as failed and so will the the other statement.
I had tried the second previously and found it did work but comes back as failed
If you just want to get rid of either/both of those files, you don’t need to check for their existence - the delete fails silently if the file doesn’t exist
So you just need relevance to check for either of the files
exists files ("mrt-kb890830.exe"; "mrt.exe") of native system folder