Another If, Else Statement

(imported topic written by SystemAdmin)

Below if my action statement. I get a fail on on "if {exist C:\Program Files\Windows SteadyState\XML\SoftwareUpdates.old} "

extract WindowsSteadyState.tmp

wait “{pathname of system folder & “\msiexec”}” /i “{(pathname of client folder of current site) & “__Download\steadystate.msi”}” /quiet

// Moves SCTSymantecEndpointUpdate.vbs to directory

copy “__Download\SCTSymantecEndpointUpdate.vbs” “{name of drive of windows folder}\Program Files\Windows SteadyState\Scripts\SCTSymantecEndpointUpdate.vbs”

if {exist C:\Program Files\Windows SteadyState\XML\SoftwareUpdates.old}

delete “C:\Program Files\Windows SteadyState\XML\SoftwareUpdates.old”

else

// Renames SoftwareUpdates.XML to SoftwareUpdates.old then copies new SoftwareUpdates.XML to directory

move “{name of drive of windows folder}\Program Files\Windows SteadyState\XML\SoftwareUpdates.XML” “{name of drive of windows folder}\Program Files\Windows SteadyState\XML\SoftwareUpdates.old”

copy “__Download\SoftwareUpdates.XML” “{name of drive of windows folder}\Program Files\Windows SteadyState\XML\SoftwareUpdates.XML”

endif

(imported comment written by MattBoyd)

The same rules of relevance apply when you use it in an action.

-Strings (such as file names) must be enclosed in quotes.

-If you don’t include the ‘file’ inspector in your statement, it will always evaluate to TRUE. This is because you would only be check if the string exists and not the actual file.

Here is what that if statement show look like:

if {exist file “C:\Program Files\Windows SteadyState\XML\SoftwareUpdates.old”}

Note: If you aren’t already, I strongly recommend using the QnA (relevance) debugger for testing your relevance before putting it into a task/fixlet: http://support.bigfix.com/fixlet/

(imported comment written by SystemAdmin)

Thank you, that did it