Code:
$ProductType=ReadValue('HKLM\Software\Microsoft\Windows NT\CurrentVersion','ProductName')

If Instr($ProductType,"Windows 7")
  ;Do Win 7 Stuff
EndIf

If Instr($ProductType,"Windows XP")
  ;Do Win XP Stuff
EndIf