I have this command in my kixtart startup script

 Code:
shell 'netsh advfirewall firewall add rule name="WSUS Pub Host" dir=in program="%winDir%\System32\SvcHost.exe" remoteip=localsubnet action=allow'


This adds the firewall rule beautifully. What I did not realise is that it adds a new rule every single time the computer is restarted.

I have determined that I need to run this command to check if rule exists.
 Code:
netsh advfirewall firewall show rule name="WSUS Pub Host


However, I cannot work out how to do a logic like this: I know the coding is wrong!

 Code:
if shell 'netsh advfirewall firewall show rule name="Allow WSUS Package Publisher Service Host"' = 1
? "Firewall rule does exist"
else
? "Firewall rule does not exist"
shell 'netsh advfirewall firewall add rule name="WSUS Pub Host" dir=in program="%winDir%\System32\SvcHost.exe" remoteip=localsubnet action=allow'
endif


How do I get a shell to output success or failure in the above example. Thanks dudes!