Reputation: 121
Hi Is there a way to determine windows os version in shell script ?
My requirement is
if OS_Version >= win_vista run cmd1 else run cmd2
Upvotes: 1
Views: 944
Reputation: 7706
The command to get the version is ver. Parse the version.txt file then do your compare.
C:\>ver >version.txt
C:\>type version.txt
Microsoft Windows [Version 6.1.7601]
Upvotes: 2