A batch file to retrieve the serial number of your PC

April 2018

Issue


I would like to retrieve the serial number of a PC in a text file via a small .bat script.
I know that the command "wmic csproduct" gives the serial, but how to implement it?

Solution

  • wmic csproduct get identifyingnumber > c:\serial_number.txt 

Thanks to barnabe0057
Published by aakai1056. Latest update on August 11, 2011 at 09:59 AM by aakai1056.
This document, titled "A batch file to retrieve the serial number of your PC," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).
USB Flash Drive Not Detected in Windows
Windows - Numeric keys not working (Numpad)