Get the App
SLTechnology News&Howtos  ›  Development  › 

The usage of the VBS property SerialNumber

Shulou Source: shulou.com Published: 2022-06-03 19:53:47 11月12日 Update

This article mainly explains "the usage of VBS attribute SerialNumber". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the usage of VBS attribute SerialNumber".

Returns a decimal serial number that uniquely identifies a disk volume.

Object.SerialNumber

Object should be the name of the Drive object.

Description

You can use the SerialNumber property to ensure that the correct disk is inserted in the removable media drive.

The following code illustrates how to use the SerialNumber property:

Function ShowDriveInfo (drvpath) Dim fso, d, s T Set fso = CreateObject ("Scripting.FileSystemObject") Set d = fso.GetDrive (fso.GetDriveName (fso.GetAbsolutePathName (drvpath) Select Case d.DriveType Case 0: t = "unknown" Case 1: t = "removable" Case 2: t = "fixed" Case 3: t = "network" Case 4: t = "CD-ROM" Case 5: t = "RAM disk "End Select s =" Drive "& d.DriveLetter &":-"& t s = s &"

"&" Serial number: & d.SerialNumberShowDriveInfo = sEnd Function Thank you for your reading. This is the content of "the usage of VBS attribute SerialNumber". After the study of this article, I believe you have a deeper understanding of the use of VBS attribute SerialNumber, and the specific use needs to be verified in practice. Here, the editor will push more articles on related knowledge points, welcome to follow us!

Tags: Properties disk learning content sequence serial number drive mobile drive code decimal name media object that is ideas situations articles more identification Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL NVidia MariaDB Apple