I'm so glad I found this site! Thanks ahead of time for your help.
I'm looking to get the ver command to work in a batch file.
I have tried %ver% and a few others but it's not working like %date% does.
Any help is greatly appreciated!
Chonn
ver in batch file
Moderator: DosItHelp
I found what I was looking for through a co-worker. Just for future reference and to help others here was my solution.
%echo_cmd% ver | findstr -c:" 5.1." > NUL: && set OSVER=WINXP
%echo_cmd% ver | findstr -c:" 5.2." > NUL: && set OSVER=WIN2K3
%echo_cmd% ver | findstr -c:" 6.0." > NUL: && set OSVER=WIN2K8
Good luck!
Chonn
%echo_cmd% ver | findstr -c:" 5.1." > NUL: && set OSVER=WINXP
%echo_cmd% ver | findstr -c:" 5.2." > NUL: && set OSVER=WIN2K3
%echo_cmd% ver | findstr -c:" 6.0." > NUL: && set OSVER=WIN2K8
Good luck!
Chonn