Results 1 to 10 of 10
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post
    I currently use batch comands like: ver | find "XP" > nul to detect the current operating system. Would I use "W7" instead of "XP" to detect Windows 7? If not, then what?

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Quote Originally Posted by Chuck Tucker View Post
    I currently use batch comands like: ver | find "XP" > nul to detect the current operating system. Would I use "W7" instead of "XP" to detect Windows 7? If not, then what?
    You will be delighted to know that Windows 7 (32-bit) Command Prompt "VER" gives
    Code:
    Microsoft Windows [Version 6.1.7600]
    I don't have a 64-bit version at home to see if it's any different in that, but I'm sure someone will tell you before I go into work tomorrow...
    BATcher

    Time prevents everything happening all at once...

  3. #3
    5 Star Lounger
    Join Date
    Jan 2010
    Location
    Los Angeles, CA
    Posts
    828
    Thanks
    4
    Thanked 38 Times in 34 Posts
    64-bit Windows 7 gives the same result for the ver command:

    Microsoft Windows [Version 6.1.7600]

  4. #4
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by BATcher View Post
    You will be delighted to know that Windows 7 (32-bit) Command Prompt "VER" gives
    Code:
    Microsoft Windows [Version 6.1.7600]
    I don't have a 64-bit version at home to see if it's any different in that, but I'm sure someone will tell you before I go into work tomorrow...
    Ver on XP returns "Microsoft Windows XP", but it looks like W7 doesn't indicate it that way. Looks like I would have to test for something like "Version 6" or "Version 6.1" Why Oh Why can't Microsoft be consistent -- even if consistently bad?

  5. #5
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Quote Originally Posted by Chuck Tucker View Post
    Ver on XP returns "Microsoft Windows XP", but it looks like W7 doesn't indicate it that way. Looks like I would have to test for something like "Version 6" or "Version 6.1" Why Oh Why can't Microsoft be consistent -- even if consistently bad?
    I wouldn't! I'd test for the whole string... See (for example) these posts...

    Putting on my hat as the Lounge Pedant™, I would point out that what VER is giving you is, strictly speaking, the version of CMD.EXE, not the version of Windows. But I don't think I know of a case where this causes a problem. But observe that the same major version, sub-version and minor version, can refer to more than one operating system.

    I've uploaded an end-2003 file called [attachment=87636:WHICHOS.txt] which is a BATch file. I've never got round to updating it for Vista and Windows 7 and various more-recent flavours of Server operating system, but it might be of interest...
    Attached Files Attached Files
    BATcher

    Time prevents everything happening all at once...

  6. #6
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,501
    Thanks
    30
    Thanked 205 Times in 163 Posts
    Just being nosey............

    In the original batch file, why send the result to NUL. Doesn't that defeat the very purpose of the batch file, or did I miss something?

    I removed the >NUL from the batch file text and ran it. Sure nuff, it told me what version of XP I'm running. Opening the System folder in the Control Panel told me the same thing and I didn't have to write any batch files to get the information. Windows, all versions, is quite happy to display that information. Windows 7, System Folder will likewise tell you what the version number is, of your OS you're running.

    Just a thought.
    The Doctor
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

  7. #7
    Plutonium Lounger Medico's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    12,631
    Thanks
    161
    Thanked 936 Times in 856 Posts
    Ultimate Windows Tweaker also displays the version info on it's main page, and under personalization there is a check box to allow version to be displayed on the screen 100 % of the time just above the system clock in the taskbar.
    BACKUP...BACKUP...BACKUP
    Have a Great Day! Ted


    Sony Vaio Laptop, 2.53 GHz Duo Core Intel CPU, 8 GB RAM, 320 GB HD
    Win 8 Pro (64 Bit), IE 10 (64 Bit)


    Complete PC Specs: By Speccy

  8. #8
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks to all, but my problem wasn't with determining what OS I'm running on my computer. I'm creating a CD that automatically installs lesson materials in PDF format onto our student's home computers -- and sometimes even the students (all seniors -- some even up in their 80's and 90's) don't know what operating system they have. Anyway, I have to be sure that they have Adobe Reader loaded and if not have the batch file run the install program. However, there are different Reader install files for XP, Vista and W7 so I have to have the batch file discover which OS they're using and then select the right Reader file. At the moment I think I've got it running, but I won't know for sure until I get access to other computers next week.

  9. #9
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Chuck: especially for you I went to work today* to obtain the following information obtained from Command Prompt VER:

    Code:
    Windows XP Pro:               Microsoft Windows XP [Version 5.1.2600]
    Windows Server 2003 and R2:   Microsoft Windows [Version 5.2.3790] 
    Windows 2008 64-bit:          Microsoft Windows [Version 6.0.6002]
    Windows 7 32-bit and 64-bit:  Microsoft Windows [Version 6.1.7600]
    * not entirely true!
    BATcher

    Time prevents everything happening all at once...

  10. #10
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for the help in identifying specific OS's. I think I now have it working OK.

Posting Permissions

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