Michael McDaniel

Software, Life & Leisure

GuidGen Console

What is it?

Guidgen console is a command line application that generates X number of guids in the format you want - pasting them to the clipboard - if you wish. But that's not all! It also allows pipe usage to find and replace GUIDs or just run in the background as a reformatter. Oh, the number of times I just needed to convert from one format to another... Try going from code to SQL to LDAP and you'll understand, but if you do understand, then this app is for you.

Don't know what a GUID/UUID is? It's basically a "Globally Unique IDentifier" composed of 16 bytes of love. But don't take my word for it, read about it on wikipedia!

Looking for an online version? try Guidgen Online

Features

  • It's FREE! - No cost! (you paid for your internet connection, right?)
  • Guidgen works on the command line. No clunky windows app needed.
  • Guidgen is a portable windows app (as long as you have the .NET framework - and who doesn't?)
  • Can replace that antiquated Visual Studio Create GUID tool.
  • Generate GUID(s) in any number of formats.
  • Find GUID(s)
  • Reformat GUID(s)
  • Replace GUID(s) with new guids.
  • Don't trust me? You can download the source code and build it yourself! (Get Visual Studio Express)

What Kind of GUIDs?

Guidgen can generate:

Zero Guids

  • 00000000-0000-0000-0000-000000000000

Sequential Guids

  • c2d0e2e8-2b60-11e1-b1ea-0024e8359915
  • c2d0e2e9-2b60-11e1-b1ea-0024e8359915
  • c2d0e2ea-2b60-11e1-b1ea-0024e8359915

Plain Vanilla Guids

  • cf120f27-074c-43c0-80cb-57c1e3493c54
  • f9018966-a96c-482c-b608-8695a95fdb0b
  • a1065215-f596-445a-9e28-1aaba3a3e2be

Available Formats (See below for examples)

  • N: 32 digits
  • D: 32 digits with hyphens
  • P: 32 digits enclosed in parentheses
  • B: 32 digits enclosed in Brackets
  • CP: c/c++ format
  • GUID: c/c++ format with declaration
  • DEFINE_GUID: c/c++ format with declaration
  • OLECREATE: c++/COM format with declaration
  • H: Hex byte array
  • HC#: Hex byte array in c/c++/c# format
  • HVB: Hex byte array in VB.NET format
  • HLDAP: Hex byte array in LDAP format
  • ORACLE: ORACLE Hex byte array
  • ORACLE_HEXTORAW: ORACLE Hex byte array with declaration
  • BASE64: Base64 of byte array - single instance
  • BASE64C: Base64 of byte array - Combined bytes from all GUIDs

Usage

c:\> guidgen.exe /?

usage: GuidGen.exe [N|D|P|B|C|CP|GUID|OLECREATE|DEFINE_GUID|H|HC#|HVB|HLDAP|ORACLE|ORACLE_HEXTORAW|BASE64|BASE64C] [/G|/S|/Z] [/nocopy] [/n (number)] [/u] Output Formats: N: 32 digits 0102030405060708090a0b0c0d0e0f10 D: 32 digits separated by hyphens (DEFAULT) 01020304-0506-0708-090a-0b0c0d0e0f10 P: 32 digits separated by hyphens, enclosed in (curly) braces {01020304-0506-0708-090a-0b0c0d0e0f10} B: 32 digits separated by hyphens, enclosed in brackets [01020304-0506-0708-090a-0b0c0d0e0f10] C: c format 0x01020304,0x0506,0x0708,0x090a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10 CP: c format, enclosed in (curly) braces {0x01020304,0x0506,0x0708,0x090a,{0x0b,0x0c,0x0d,0x0e,0x0f,0x10}} GUID: c format, enclosed in (curly) braces static const GUID <<name>> = 0x01020304,0x0506,0x0708,0x090a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10; DEFINE_GUID: c format, enclosed in (curly) braces DEFINE_GUID(<<name>>,0x01020304,0x0506,0x0708,0x090a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10) OLECREATE: c format, enclosed in (curly) braces IMPLEMENT_OLECREATE(<<class>>,<<external_name>>,0x01020304,0x0506,0x0708,0x090a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10) H: HEX byte array 0403020106050807090a0b0c0d0e0f10 HC#: CSharp Hex byte array 0x04,0x03,0x02,0x01,0x06,0x05,0x08,0x07,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10 HVB: VB Hex byte array &H04,&H03,&H02,&H01,&H06,&H05,&H08,&H07,&H09,&H0a,&H0b,&H0c,&H0d,&H0e,&H0f,&H10 HLDAP: Hex byte array in ldap query form \\04\\03\\02\\01\\06\\05\\08\\07\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10 ORACLE: ORACLE Hex byte array 04030201-0605-0807-090a-0b0c0d0e0f10 ORACLE_HEXTORAW: ORACLE Hex byte array with declaration HEXTORAW('04030201-0605-0807-090a-0b0c0d0e0f10') BASE64: BAMCAQYFCAcJCgsMDQ4PEA== BASE64C: combine bytes to single base64 string AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= Type of GUID to create G: New Guid (default) Z: Zero Guid S: Sequential Guid Additional Arguments /u: returns format in uppercase (unless base64) /count (number): will generate the given number of guids /n (number): same as /count /Find (format): Finds guids in format (no copy) /l: shows line number for found guids /copy: forces copy to clipboard /nocopy: does not copy to clipboard /Replace: replaces guid with (/Z|/S|/G) or same guid to specified output format (nocopy) (no-BASE64C) /Replace [format]: replaces specified format with same guid or new guid if (/Z|/S|/G) is specified to specified output format (nocopy) /ReplaceByLine: like replace, but does everything per input line. (see above) /ReplaceByLine [format]: like replace, but does everything per input line. (see above) /guid (GUID): uses specified (GUID) as input for find and replace. /clipboard: uses clipboard for find and replace Notes: if find or replace is used and data is not piped in (ex: more find.txt | guidgen /find) then enter guids and then type "quit" to find/replace and end.

What dependencies does it have?

The latest version is built against the .NET Framework version 4.6.1.
available at: http://go.microsoft.com/fwlink/?LinkId=671729

How do I install it?

Download it from the link above or install via chocolatey: PS C:\> choco install guidgen-console

Where do I install it?

Install it where ever you want. I usually drop it into c:\windows\system32 so I can run it from anywhere.
If you used chocolatey, then it should be in %ALLUSERSPROFILE%\chocolatey\bin

Can I change the defaults?

Yes! Add (or change) guidgen.exe.config <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="default:output:format" value="D" /> <add key="default:guid:type" value="G" /> <add key="default:example" value="01020304-0506-0708-090a-0b0c0d0e0f10" /> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> </startup> </configuration>

How do I add it to Visual Studio Tools?

Goto: Tools > External Tools
Set the title, location where you saved it and any command line arguments.
Click the "Use Output Window"
Move it to the top.
Click ok.

I also add a quick key Ctrl-~
Goto: Tools > Options > Environment > Keyboard
Select "Tools.ExternalCommand1" (if you moved it to the top...)
Press the key combination.
Click ok.

Is there any copyright for the source?

I made this to use for myself. You are free to change, modify or corrupt your own version without any implied consent.
license: WTFPL

Do you like it? Or have a comment, question or problem?

Report an issue
Send me a note