<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Any possibility to extract BIOS & HDD serial number?]]></title>
	<link rel="self" href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=408&amp;type=atom" />
	<updated>2016-02-14T07:14:10Z</updated>
	<generator>PunBB</generator>
	<id>http://forums.approximatrix.com/viewtopic.php?id=408</id>
		<entry>
			<title type="html"><![CDATA[Re: Any possibility to extract BIOS & HDD serial number?]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2369#p2369" />
			<content type="html"><![CDATA[<p>Try with WMIC commands</p><p><a href="http://net-informations.com/q/mis/wmic.html">http://net-informations.com/q/mis/wmic.html</a></p><p>Macin</p>]]></content>
			<author>
				<name><![CDATA[georgemacin]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3661</uri>
			</author>
			<updated>2016-02-14T07:14:10Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2369#p2369</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Any possibility to extract BIOS & HDD serial number?]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1742#p1742" />
			<content type="html"><![CDATA[<p>If you&#039;re confident users have Windows Vista or higher, you can retrieve both using the <a href="http://support.microsoft.com/kb/558124">wmic</a> command.&nbsp; An example Fortran program is below:</p><div class="codebox"><pre><code>program serial
implicit none

    character(10), parameter::outfile = &quot;serial.txt&quot;
    
    character(len=40)::ignore, results

    call get_serial(&quot;diskdrive&quot;, outfile)
    
    ! Load in results
    open(unit=100, file=&quot;serial.txt&quot;, status=&quot;old&quot;)
    read(100, *) ignore
    read(100, *) results
    
    print *, &quot;Hard disk serial #: &quot;, trim(results)
    close(100)
    
    call get_serial(&quot;bios&quot;, outfile)
    
    ! Load in results
    open(unit=100, file=&quot;serial.txt&quot;, status=&quot;old&quot;)
    read(100, *) ignore
    read(100, *) results
    
    print *, &quot;Bios serial #: &quot;, trim(results)
    close(100)
    
    call unlink(outfile)
    
    contains
    
    subroutine get_serial(serialid, finalfile)
    implicit none    
    
    character(*), intent(in)::serialid
    character(*), intent(in)::finalfile
    
    character(128)::serialcmd
    
        serialcmd = &quot;wmic &quot;//&amp;
                    trim(serialid)//&amp;
                    &quot; get serialnumber &gt; unicode.txt &amp;&amp; type unicode.txt &gt; &quot;//&amp;
                    trim(finalfile)
        
        call execute_command_line(trim(serialcmd))
        
        call unlink(&quot;unicode.txt&quot;)
    
    end subroutine get_serial
end program serial</code></pre></div><p>If you&#039;ll notice, I redirect the results of <strong>wmic</strong> to temporary file <em>unicode.txt</em> and then subsequently redirect it via &quot;TYPE&quot; to another final file.&nbsp; The reason for this double-redirect is that the original output seems to be in a unicode format, but ASCII is so much easier to deal with when reading in results in Fortran.&nbsp; Hence, I use the &quot;TYPE&quot; command, which should always generate pure ASCII.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-12-29T13:24:02Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1742#p1742</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Any possibility to extract BIOS & HDD serial number?]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1737#p1737" />
			<content type="html"><![CDATA[<p>Hello guys</p><p>I m looking for a code to extract BIOS &amp; HDD serial number (to string). Can anybody suggest?</p><p>Thank you.</p>]]></content>
			<author>
				<name><![CDATA[dollarbulldog]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3591</uri>
			</author>
			<updated>2014-12-27T13:55:08Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1737#p1737</id>
		</entry>
</feed>
