Home > front end >  Get hard disk serial number from local disk in batch
Get hard disk serial number from local disk in batch

Time:10-05

I need to get the model and serial number of the disk on which windows is installed (local disk C). This way I can get the one from all disks, but how can I get the one from the local disk only?

wmic diskdrive get model,serialNumber 

CodePudding user response:

This command displays the virtual disk information of the computer

Get-Disk -Number 0 | % {$_.FriendlyName,$_.SerialNumber}

If you want to run it in cmd or batch file

powershell.exe -command "Get-Disk -Number 0 | % {$_.FriendlyName,$_.SerialNumber}"
  • Related