Output machine serial number

I recently had the need to output the machine serial number to a share which would act as part of the asset tracking regime.

Below is the script which I created & saved as a .bat file then used GPO to run at computer startup.

wmic bios get serialnumber | Out-File "\\domain.local\share$\Client_Info\Student\$env:COMPUTERNAME-SERIAL.txt"