Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
Has anyone developed some code to obtain the disk id of a given hard disk (described by the letter)? Thanks MrT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() '--------------------------------------------------------------- Function DiskVolumeId(Drive As String) As String '--------------------------------------------------------------- Dim sTemp As String Dim iPos As Long iPos = InStr(1, Drive, ":") Drive = IIf(iPos 0, Left(Drive, iPos), Drive & ":") sTemp = Hex(CreateObject("Scripting.FileSystemObject") _ .Drives.Item(CStr(Drive)).SerialNumber) DiskVolumeId = Left(sTemp, 4) & "-" & Right(sTemp, 4) End Function -- HTH Bob Phillips (remove xxx from email address if mailing direct) "MrT" wrote in message ... Hi there, Has anyone developed some code to obtain the disk id of a given hard disk (described by the letter)? Thanks MrT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks! simple and perfect ! Works even when calling it directly with a path!
"Bob Phillips" wrote: '--------------------------------------------------------------- Function DiskVolumeId(Drive As String) As String '--------------------------------------------------------------- Dim sTemp As String Dim iPos As Long iPos = InStr(1, Drive, ":") Drive = IIf(iPos 0, Left(Drive, iPos), Drive & ":") sTemp = Hex(CreateObject("Scripting.FileSystemObject") _ .Drives.Item(CStr(Drive)).SerialNumber) DiskVolumeId = Left(sTemp, 4) & "-" & Right(sTemp, 4) End Function -- HTH Bob Phillips (remove xxx from email address if mailing direct) "MrT" wrote in message ... Hi there, Has anyone developed some code to obtain the disk id of a given hard disk (described by the letter)? Thanks MrT |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
http://support.microsoft.com/kb/291573/en-us
How To Use Visual Basic to List Active Logical Drives http://support.microsoft.com/default...b;en-us;192689 HOWTO: Get UNC Path From a Mapped Network Share's Drive Letter maybe places to start. -- Regards, Tom Ogilvy "MrT" wrote: Hi there, Has anyone developed some code to obtain the disk id of a given hard disk (described by the letter)? Thanks MrT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
disk full?? | Excel Discussion (Misc queries) | |||
Save a file to disk without re-formating the disk | Excel Discussion (Misc queries) | |||
I get a "Disk full" message,what disk? | New Users to Excel | |||
Download files from 3.5 disk in excel but system said disk need fo | Excel Discussion (Misc queries) | |||
Disk is full | Excel Discussion (Misc queries) |