The environment variable can be used to know about this. The QTP variables OS and OS Version are used to perform the action in the script.