How to get the OS type

whether it is XP , Win 7 for Vista, how to get this

Comments

  • Are you looking to get the OS of the SUT or your host computer?

    The OSInfo, platform, and systemVersion commands (see manual) seem to apply to the host computer only.


    manual wrote:
    ?OSInfo function
    What it Does
    The OSInfo function returns a property list containing various items of information about the operating system of the
    machine where SenseTalk is running.
    When to Use It
    Call OSInfo to learn information about the host operating system.
    Examples
    put the OSInfo

    ?platform function
    What it Does
    The platform function returns the name of the host operating system where SenseTalk is running, such as
    "MacOS", "Linux", etc.
    When to Use It
    Call platform to make decisions based on SenseTalk's host platform.
    Examples
    if the platform is "MacOS" then exit script

    ?systemVersion function
    What it Does
    The systemVersion function returns the version number of the operating system on the host computer where
    SenseTalk is running.
    When to Use It
    Use systemVersion to check which OS version a script is running on.
    Examples
    if systemVersion() begins with "10.5" then put "Leopard!"


    I just tried these out on my XP host machine. Looks like you just need the "ProductName" property of osInfo.
    put the productName property of osInfo //Prints "Windows XP" for me
    
  • . syntax error property coming
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    The syntax of that command wasn't quite right. Try one of these:
    put the productName of the osInfo
    put property productName of osInfo()
    
    The functions mentioned are all good for getting information about the system where eggPlant is running. If you need to know what system the SUT is, the simplest approach is probably to look for a unique image (such as the Apple logo on a Mac, or the Start menu button on a Windows system, which I believe looks different on different versions of Windows).
Sign In or Register to comment.