I am trying to get the below command to run ONLY once. It reboots the machine after running so it needs to not run every login. also it needs to detect Windwos XP pro SP2. if not sp2 it shoudl terminate. What I have so far does not work.

If Instr(@PRODUCTTYPE,"Windows XP Professional")
If Instr(@CSD, "Service pack 2")
SHELL '%comspec% /c "CPAU -u domain\username -p password -profile -ex "msiexec /i \\tahoe\packages\mmclientsp2.msi MASIP=192.168.5.40 /qn"'
Endif
Oh yeah it use CPAU to run as with admin rights.