none
Translate RRS feed

  • Question

  • good...

    What I want is to convert a path (C:\Windows\prefetch) from a folder to a GUID
    Is it possible to perform this operation?


    Can anyone help me with this please

    First of all, Thanks

    Wednesday, December 4, 2019 12:14 AM

Answers

  • Hi,

    Someone has asked similar questions before.

    You need to P/Invoke GetVolumeNameForVolumeMountPoint. You can try my code as follows:

    <DllImport("kernel32.dll", SetLastError:=True)>
        Private Shared Function GetVolumeNameForVolumeMountPoint(ByVal lpszVolumeMountPoint As String,
        <Out> ByVal lpszVolumeName As StringBuilder, ByVal cchBufferLength As Integer) As Boolean
    
        End Function
    
        Private Shared Function GetVolumeGuidPath(ByVal mountPoint As String) As String
            Dim sb As StringBuilder = New StringBuilder(50)
            GetVolumeNameForVolumeMountPoint(mountPoint, sb, 50)
            Return sb.ToString()
        End Function

    Hope it be helpful.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by JenCarlos Wednesday, December 4, 2019 3:49 AM
    Wednesday, December 4, 2019 2:07 AM
    Moderator

All replies

  • A GUID is a unique code generated based on time. It's not encoded by the person creating it.

    George Frias - AWWshop, Wiki1978

    Wednesday, December 4, 2019 12:15 AM
  • So, isn't it possible to create our own GUID?
    Wednesday, December 4, 2019 12:18 AM
  • Hi

    If you did, then it wouldn't be a GUID, it would be a random number/string. That can easily be done.


    Regards Les, Livingston, Scotland

    Wednesday, December 4, 2019 12:21 AM
  • very good
    Thanks for the info
    Wednesday, December 4, 2019 12:25 AM
  • I wouldn't say I created the logic that makes a GUID, but my software does create a GUID.

    https://funboots.drivehq.com/software/programming/guid-maker/1/


    George Frias - AWWshop, Wiki1978

    Wednesday, December 4, 2019 12:27 AM
  • Thank you very much
    Wednesday, December 4, 2019 12:37 AM
  • Hi,

    Someone has asked similar questions before.

    You need to P/Invoke GetVolumeNameForVolumeMountPoint. You can try my code as follows:

    <DllImport("kernel32.dll", SetLastError:=True)>
        Private Shared Function GetVolumeNameForVolumeMountPoint(ByVal lpszVolumeMountPoint As String,
        <Out> ByVal lpszVolumeName As StringBuilder, ByVal cchBufferLength As Integer) As Boolean
    
        End Function
    
        Private Shared Function GetVolumeGuidPath(ByVal mountPoint As String) As String
            Dim sb As StringBuilder = New StringBuilder(50)
            GetVolumeNameForVolumeMountPoint(mountPoint, sb, 50)
            Return sb.ToString()
        End Function

    Hope it be helpful.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by JenCarlos Wednesday, December 4, 2019 3:49 AM
    Wednesday, December 4, 2019 2:07 AM
    Moderator
  • It works thank you very much
    Wednesday, December 4, 2019 3:49 AM