Windows XP Firewall at the command line

Disable the firewall completely
netsh.exe firewall set opmode mode=disable profile=all

Set a portnumber open
netsh.exe firewall set portopening tcp 123 MYSERVICE enable all
Open port 123 with a description/name MYSERVICE

Set an allowed program
netsh.exe firewall set allowedprogram C:\MYPROGRAM.exe
Give C:\MYPROGRAM.exe full access

Full details at Microsoft Support KBID 875357