Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    distinguishing 2000 from NT operating system

    Is there a way to dynamically distinguish the 2000 operating system from the NT operating system from within a batch file?

    (Our system variable still shows "Windows_NT" even though the operating system is 2000.)

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: distinguishing 2000 from NT operating system

    Yes, you can do it. You need to check the version of CMD.EXE that is present on the system:

    <pre>:: Is this the Win2k cmd.exe?
    IF NOT {%CMDEXTVERSION%}=={2}
    (ECHO This Program must be run in Win2000
    GOTO :Exit)</pre>

    -Mark

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: distinguishing 2000 from NT operating system

    It's worth noting that this will pop up a GUI version. From a command line, if you simply enter VER it will return the OS version. To make use of that in a batch file, you would need to assign this to a variable, and then read in the variable in some fashion.
    -Mark

  4. #4
    New Lounger
    Join Date
    Jan 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: distinguishing 2000 from NT operating system

    As ingenius as checking for the version of cmd.exe is, here is what MS has to say on the subject :

    http://support.microsoft.com/default.aspx?...b;EN-US;q190899

    Of course, winnt 4.0, windows 2000 and windows XP are all "NT"
    nt 4.0 is v4.0
    windows 2000 is 5.0
    and last but not least Xp is 5.1
    typing winver at a command line will verify all that!

    ww <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Edited by WyllyWylly to add URL markup

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •