Here is the simple script to generate GUIDs.
Code: Select all
shellobj := ComObjCreate("Scriptlet.TypeLib")
shellexec := shellobj.GUID
clipboard := shellexec
MsgBox, % clipboard
ExitApp
Code: Select all
shellobj := ComObjCreate("Scriptlet.TypeLib")
shellexec := shellobj.GUID
clipboard := shellexec
MsgBox, % clipboard
ExitApp
Code: Select all
; Register our object so that other scripts can get to it. The second
; parameter is a GUID which I generated. You should generate one unique
; to your script. You can use [CreateGUID](http://goo.gl/obfmDc).
ObjRegisterActive(ActiveObject, "{6B39CAA1-A320-4CB0-8DB4-352AA81E460E}")
Code: Select all
StartTime := A_TickCount
FileDelete, %A_Temp%\TempReg.reg
RunWait, %A_WinDir%\Regedit.exe /E %A_Temp%\TempReg.reg
FileRead, RegistryContents, %A_Temp%\TempReg.reg
Start:
NewGUID := ComObjCreate("Scriptlet.TypeLib").GUID
IfInString, RegistryContents, %NewGUID%
Goto Start
clipboard := NewGUID
ElapsedTime := A_TickCount - StartTime
ElapsedTime := ElapsedTime /1000
MsgBox, % clipboard "`n Time Taken in Seconds: " ElapsedTime
Code: Select all
clipboard := ComObjCreate("Scriptlet.TypeLib").GUID
MsgBox, % clipboard
jeeswg wrote:But how can we be sure that the GUID is unique!?
Code: Select all
shellobj := ComObjCreate("Scriptlet.TypeLib")
shellexec := shellobj.GUID
Return to “Scripts and Functions”
Users browsing this forum: daeinai, Jasonosaj, kazhafeizhale and 30 guests