Re: Converting GUID to "packed" GUID
- From: "McKirahan" <News@xxxxxxxxxxxxx>
- Date: Fri, 21 Oct 2005 07:31:40 -0500
"John Paulsson" <etique@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:#wCimwg1FHA.736@xxxxxxxxxxxxxxxxxxxxxxx
> McKirahan wrote:
> > "John Paulsson" <etique@xxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:#lubc4c1FHA.2004@xxxxxxxxxxxxxxxxxxxxxxx
> >> How do you convert a GUID like {E09B48B5-E141-427A-AB0C-D3605127224A}
to
> >> the packed (commonly used in the registry) format like
> >> 5B84B90E141EA724BAC03D06157222A4?
> >
> > Dim sGUID
> > sGUID = "E09B48B5-E141-427A-AB0C-D3605127224A"
> > WScript.Echo sGUID & vbCrLf & Replace(sGUID,"-",""))
>
> Have a look at the compressed GUID format again..
Sorry, I didn't notice that the "packed" format is the concatenation
of the reverse of each GUID dash-separated "chunk".
Will this work?
WScript.Echo PackGUID("{E09B48B5-E141-427A-AB0C-D3605127224A}")
Function PackGUID(guid)
PackGUID = ""
'*
Dim temp
temp = Mid(guid,2,Len(guid)-2)
Dim part
part = Split(temp,"-")
Dim pack
pack = ""
Dim i, j
For i = 0 To UBound(part)
For j = Len(part(i)) To 1 Step -1
pack = pack & Mid(part(i),j,1)
Next
Next
'*
PackGUID = pack
End Function
.
- References:
- Converting GUID to "packed" GUID
- From: John Paulsson
- Re: Converting GUID to "packed" GUID
- From: John Paulsson
- Converting GUID to "packed" GUID
- Prev by Date: Re: Date-Time formatting
- Next by Date: Re: Date-Time formatting
- Previous by thread: Re: Converting GUID to "packed" GUID
- Next by thread: RE: Running a vbscript on a remote XpPro computer. Error: remote
- Index(es):
Relevant Pages
|