Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Generating a GUID

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,59248
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Generating a GUID
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Generating a GUID - 4/17/2008 3:24:53 AM   
  TNO


Posts: 974
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
While developing my new scripting component, I came across the problem of generating GUIDs. If it was going to be a component like any other I would have just used the WSC wizard to create one. But since I have multiple ProgID and multiple components all in one file the wizard just wasn't going to cut it. I tried searched the MSDN archives and couldn't find a tool that could generate one (without having to download some ungodly SDK package). Little did I know that right under my nose there was functionality available:


      

Isn't it strange that the simplest problems are sometimes the hardest to solve?

_____________________________

Consolidated Script Component: Now in Testing stage!

A universe of complexity...
 
 
Post #: 1
 
 RE: Generating a GUID - 4/17/2008 6:13:18 AM   
  ebgreen


Posts: 4408
Score: 29
Joined: 7/12/2005
Status: offline
Thanks TNO. The Powershell way:

([System.Guid]::NewGuid()).ToString()

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to TNO)
 
 
Post #: 2
 
 RE: Generating a GUID - 5/2/2008 1:11:02 AM   
  Rischip


Posts: 341
Score: 2
Joined: 3/26/2007
Status: online
I use this functionality for a file renaming script I created.
You have to recreate the object each time to get a new GUID. (Of course I could be missing something)

So I put it in a function like this:


      

_____________________________

Rischip
Author of - The Grim Linker

(in reply to TNO)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Generating a GUID Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts