- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- how do I determine the O/S version from a .bat scr...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2004 10:28 PM
тАО08-16-2004 10:28 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-16-2004 11:33 PM
тАО08-16-2004 11:33 PM
SolutionJust use the good old 'ver' in the .bat file.
On the newer win systems the ending is more like .cmd instead of .bat, isn't it ?
Rgds
Alexander M. Ermes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2004 06:05 PM
тАО08-18-2004 06:05 PM
Re: how do I determine the O/S version from a .bat script
Note: I didn't have 2000 running, so could only supply the VER values for XP and 2003.
Example:
FOR /F "tokens=5 delims= " %%i in ('ver') do set my_ver=%%i
if %my_ver%==5.1.2600] set my_os=XP
if %my_ver%==5.2.3790] set my_os=2003
echo My OS is: %my_os%
Rather than echo out the OS, you could have your batch file skip to different areas based on the OS (my_os in this example).
Jon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2004 09:10 AM
тАО08-19-2004 09:10 AM
Re: how do I determine the O/S version from a .bat script
You can try to analyse the commands inside and the path of these command, changing windows version have changed the path of the dos (or emulated dos) commands.
the ver command may apply to the envoronment, I mean if you boot a floppy disk with the file system, you can run this command to know which version you booted from, but usualy at the end of the boot, the version already appear
marino
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2004 08:01 PM
тАО08-19-2004 08:01 PM
Re: how do I determine the O/S version from a .bat script
Thanks for your help.