Action Script using "IF" "Then"

(imported topic written by Edj)

I am currently creating an action script using IF…Then…Else…Elseif.

I am encountering an issue in which all lines are executed, ignoring the IF…Then. I have listed the action text.

Thanks for the help.

Edj

if {value “ProductType” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions” of registry = “WinNT”} then

dos del /f /q “{pathname of windows folder & “\Iama-nonbranchserver.exe”}”

delete __appendfile

appendfile Yes

move __appendfile “{pathname of windows folder & “\Iama-nonbranchworkstation.exe”}”

dos del /f /q “{pathname of windows folder & “\shore.exe”}”

delete __appendfile

appendfile Nonbranch Workstation

move __appendfile “{pathname of windows folder & “\shore.exe”}”

delete __appendfile

else

dos del /f /q “{pathname of windows folder & “\Iama-nonbranchserver.exe”}”

delete __appendfile

appendfile LOB

appendfile Test Server

move __appendfile “{pathname of windows folder & “\Iama-nonbranchserver.exe”}”

dos del /f /q “{pathname of windows folder & “\shore.exe”}”

delete __appendfile

appendfile Nonbranch Server

move __appendfile “{pathname of windows folder & “\shore.exe”}”

delete __appendfile

endif

(imported comment written by jessewk)

Edj,

Try removing the ‘then’ text from your action script. The sytanx for an if statement in an action script is:

if {EXPR1}
statements to execute on EXPR1 = TRUE
elseif {EXPR2}
statements to execute on EXPR1 != TRUE and EXPR2 = TRUE
else
statements to execute on EXPR1 != TRUE and EXPR2 != TRUE
endif

(imported comment written by Edj)

Thanks Jessewk