How to get the full name of a system disk, not a character, is the full name, such as: Local Disk (C:)?

Source: Internet
Author: User
Tags exit

Private Sub Command1_Click ()
Dim Shellapp, Opanel, FolderItem1, FOLDERITEM2, Oitem
Set Shellapp = CreateObject ("Shell.Application")
Set Opanel = shellapp.namespace (0)

Set FolderItem2 = Nothing
For each FolderItem1 in Opanel.items
If folderitem1.name = "My Computer" Then
Set FolderItem2 = FolderItem1.Getfolder:Exit for
End If
Debug.Print Folderitem1.name
Next

If FolderItem2 is nothing Then
MsgBox "Can't find the item! "
Exit Sub
End If

Set Oitem = Nothing
For each oitem in Folderitem2.items
Debug.Print Oitem.name
Next
End Sub



The output results are as follows:

Control Panel 3.5 Floppy disk (A:) WINDOWS98 (C:) program (D:) Local Disk (E:) Data Backup (F:) disc (G:)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.