wmic os get BuildNumber
Posted: 01 Oct 2021 08:08
Hi Folks
I have got my script working great with the help from users on DosTips, (thanks so much to Compo) only one piece of the jig saw left and that is to get the build number, but just not sure how to go about that, can someone please help? see script below. any info would be greatly appreciated
Many Thanks
John
I have got my script working great with the help from users on DosTips, (thanks so much to Compo) only one piece of the jig saw left and that is to get the build number, but just not sure how to go about that, can someone please help? see script below. any info would be greatly appreciated
Many Thanks
John
Code: Select all
@SetLocal EnableExtensions
@For /F Tokens^=6-10^ Delims^=^" %%G In ('
( Echo(NICConfig Where IPEnabled^='TRUE' Get IPAddress /Format:MOF ^&
Echo(BIOS Get Get BuildNumbe /Format:MOF ^&
Echo(BIOS Get SerialNumber /Format:MOF ^&
Echo(CSProduct Get Name /Format:MOF^) ^| %SystemRoot%\System32\wbem\WMIC.exe
') Do @If "%%K" == "" (If Defined SN (Set "PC=%%G") Else Set "SN=%%G"
) Else Set "IP=%%I"
@( Echo Event,Date,Time,Device,User,IP,SN,Model,Build
Echo Login,%DATE%,%TIME:~,8%,%COMPUTERNAME%,%USERNAME%,%IP%,%SN:~,20%,%PC%
) 1>"//PC500/Source/%RANDOM%.csv"