iopadventures.blogg.se

Get hard drive serial number vba
Get hard drive serial number vba







get hard drive serial number vba get hard drive serial number vba

Disadvantages of serial-only licensing: You have absolutely no control over. Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. Software licensing allows you to get paid for each copy of your software. Objects (Visual Basic for Applications).

get hard drive serial number vba

S = s & "Free Space: " & FormatNumber(d.FreeSpace/1024, 0) Set d = fs.GetDrive(fs.GetDriveName(drvPath)) Set fs = CreateObject("Scripting.FileSystemObject") The following code illustrates the use of the DriveLetter property. The DriveLetter property returns a zero-length string ('') if the specified drive is not associated with a drive letter, for example, a network share that has not been mapped to a drive letter. The DriveLetter property returns a zero-length string ("") if the specified drive is not associated with a drive letter, for example, a network share that has not been mapped to a drive letter. Returns the drive letter of a physical local drive or a network share. Me.("-" & diskProperty.Name & "=" & the drive letter of a physical local drive or a network share.

get hard drive serial number vba

If Not diskProperty.Value Is Nothing Then Me.(drive.ToString & drivetype(CInt((Disk("DriveType").ToString)))) "Win32_LogicalDisk='" & drive.Substring(0, 2) & "'"ĭim Disk As _ Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loadĭim drivetype() As String = ĭim allDrives() As String = Environment.GetLogicalDrives() Putting some more if's in the code Imports System.Management The Volume serial number is included you can get that by simple Posted 1-Jul-10 0:15am tiggerc Solution 2 Hi Tiggerc, Thank you. Substitute the '.' for the computer name. I made a piece of code for you to show all drive information. Solution 1 the above will show you how to use Windows Management Interface to read the serial Number of computer A from computer no need for a program on computer A to do that. option explicit public sub gethdserial () dim objfso as filesystemobject dim objfolder as folder dim strcomputer as string strcomputer 'mycomputer' set objfso new filesystemobject set objfolder objfso.getfolder ('\\' & strcomputer & '\c') debug. This thread here has the following bit of code that you could use/adapt.









Get hard drive serial number vba