Jump to content

globally unique identifiers


Recommended Posts

I'm working on a script to ad a button to the IE-toolbar. In the registry I need to ad a key and that key needs to be unique ( GUID ). I found a program to create that key but I want to do it without using an external program. Is this possible ???? when only using AutoIt. :(

Link to comment
Share on other sites

I believe you can do it with this.........

Strait from help

; Write a single REG_SZ value

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_SZ", "Hello this is a test")

; Write the REG_MULTI_SZ value of "line1" and "line2"

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_MULTI_SZ", "line1" & @LF & "line2")

Hope ie helps

NEWHeader1.png

Link to comment
Share on other sites

I believe you can do it with this.........

Strait from help

; Write a single REG_SZ value

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_SZ", "Hello this is a test")

; Write the REG_MULTI_SZ value of "line1" and "line2"

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE", "TestKey", "REG_MULTI_SZ", "line1" & @LF & "line2")

Hope ie helps

<{POST_SNAPBACK}>

Sorry, but this is not my problem. Before I write to the registry I need to create a GUID ( this is a GUID : {A54CF7CE-93C2-4b15-8B2D-34F851ECE743} ). I could make up one myself but then there is a ( little ) chance that it is allready used by another program in the registry. The external program I have checks the registry first and then makes a new one but this needs to be done on the local computer where you run the script and that's why I want to trie to do this with AutoIt.
Link to comment
Share on other sites

Sorry, but this is not my problem. Before I write to the registry I need to create a GUID ( this is a GUID : {A54CF7CE-93C2-4b15-8B2D-34F851ECE743} ). I could make up one myself but then there is a ( little ) chance that it is allready used by another program in the registry. The external program I have checks the registry first and then makes a new one but this needs to be done on the local computer where you run the script and that's why I want to trie to do this with AutoIt.

<{POST_SNAPBACK}>

Sorry, but no, thats not how a GUID is created. I don't know the actual algorithm but I do recall reading that GUID's use time as one of the seeds so the only way to generate the same GUID twice is to literally set your clock back so that it can use the same time (Presumably, one of the other seeds will be different, though). GUID's are globally unique; if you create a GUID, no other PC on this planet should have that same GUID appear anywhere on it unless you put it there. There is no registry checking involved.
Link to comment
Share on other sites

Sorry, but this is not my problem. Before I write to the registry I need to create a GUID ( this is a GUID : {A54CF7CE-93C2-4b15-8B2D-34F851ECE743} ). I could make up one myself but then there is a ( little ) chance that it is allready used by another program in

OLE32.dll provides two functions to create a GUID as a string. "CoCreateGuid" and "StringFromGUID2". You could call these with DllCall. Search this forum for DllCall and DllStruct to get an idea on how to call external function from an AutoIT script. Search google for some VBSCRIPT examples with those two functions an the way they are called.

OR: simply use the UDF from this link ;-) UID, Universal Identifier

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...