• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Skill Function to return the OS running

Stats

  • Replies 7
  • Subscribers 160
  • Views 14823
  • Members are here 0
More Content

Skill Function to return the OS running

Khurana
Khurana over 14 years ago

I know about cdsPlat() but it's not suitable since it just returns "wint" - I'd like to know of a function that tells me what version of Windows I have got installed i.e. Win XP or Windows 7 without getting too creative.  Any pointers are appreciated!

  • Cancel
  • Sign in to reply
  • eDave
    eDave over 14 years ago
    when(zerop(system("ver >os.version"))
                q = axlDMOpenFile("MISC", "os.version", "r")
                fscanf(q, "%s %s %s ", rubbish, platform, os)
                axlDMClose(q)
                deleteFile("os.version")
            )
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Khurana
    Khurana over 14 years ago

     Thank you Dave!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Ejlersen
    Ejlersen over 14 years ago

    Hi All

    Notice that you cannot be completely sure the output of "ver" is in the same format for different Windows Operating Systems.

    I've seen a response like Microsoft Windows [version 6.1.7600] (seen for Windows 7, eventhough google says it should say version 7)??

    For XP, I've seen Microsoft Windows XP [Version 5.1.2600]

    So you would need another parameter to fscanf to get a more reliable result and also, you would need to test the version number to determine the correct OS

    Best regards

    Ole

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Khurana
    Khurana over 14 years ago

    Ole,

    I didn't check the output of "ver" on Win 7 before asking this question and yeah I have experienced the same problem.  So, instead of relying on the output of "ver" to figure out the os I used isDir() to check to see if C:\Program Files (x86) folder exists on the pc; if it does then it's a Win 7 otherwise it's Win XP.

    Regards,
    Varun

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Khurana
    Khurana over 14 years ago

    Btw, another engineer here had another idea: use output of "systeminfo", which is definitely better.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information