Windows 8 and 8.1 Forums


GUID - Generate in Windows

  1. #1
    GUID - Generate in Windows

    GUID - Generate in Windows
    How to Generate a New GUID or UUID in Windows
    Published by Brink is online now
    14 Feb 2014
    Default GUID - Generate in Windows

    Published by


    Brink's Avatar
    Administrator

    Join Date: Jul 2009
    Posts: 22,573

    How to Generate a New GUID or UUID in Windows


    information   Information
    GUID (or UUID) is an acronym for 'Globally Unique Identifier' (or 'Universally Unique Identifier'). The term GUID is generally used by developers working with Microsoft technologies, while UUID is used everywhere else.

    A GUID is represented as a 32-character hexadecimal string, such as {dcab32b8-e5ec-4f09-af89-44634bc7a04d}, and is usually stored in the form of a 128bit integer. It's nearly impossible for the numbers generated for the GUID to have two numbers repeated making them unique.

    For more information about GUID, see:



    This tutorial will show you how to quickly generate a new GUID (UUID) in XP, Vista, Windows 7, and Windows 8.

    Note   Note
    Windows 7 and Windows 8 comes with the PowerShell feature included.

    In XP and Vista, you will need to download and install PowerShell.






    GUID - Generate in Windows OPTION ONE GUID - Generate in Windows
    To Generate a New GUID in PowerShell

    1. Open PowerShell, copy and paste either command below, and press Enter.

    [guid]::NewGuid()

    OR

    [guid]::NewGuid().ToString()

    2. The generated 32-character number will be the new GUID.

    Click image for larger version

    Click image for larger version





    GUID - Generate in Windows OPTION TWO GUID - Generate in Windows
    To Generate a New GUID in Command Prompt


    Note   Note
    This option uses a PowerShell command in a command prompt, so you will still need to have PowerShell installed (XP and Vista).

    If you like, you can also use the command below in a .bat or .cmd file.


    1. Open a command prompt, copy and paste either command below, and press Enter.

    powershell -Command "[guid]::NewGuid()"

    OR

    powershell -Command "[guid]::NewGuid().ToString()"

    2. The generated 32-character number will be the new GUID.

    Click image for larger version

    Click image for larger version



    That's it,
    Shawn


  2. #1


    Posts : 62
    Microsoft Windows


    Cool trick. PowerShell is capable of doing so many things!

      My System SpecsSystem Spec

  3. #2


    Posts : 2,130
    Windows 8.0 x64


    Or if you are lazy like me you can make a bunch at once:
    Online GUID Generator

      My System SpecsSystem Spec

  4. #3


    Posts : 1,875
    Windows 10 Pro Prieview x64


    Why would you want to do this though? Just for VMs?
      My System SpecsSystem Spec

  5. #4


    Posts : 2,130
    Windows 8.0 x64


    Quote Originally Posted by adamf View Post
    Why would you want to do this though? Just for VMs?
    Programmers use Guids much more than users. It avoids name collisions. For example I can create a named memory mapped file, or mutex, or semaphore. Programmers used to do stuff like make up names they thought would be unique. Example, MyVeryOwnUniqueSeamaphoreNamexxxxx. If someone else just happened to come up with the same name you could have 2 programs fighting over the resource. But if I use a Guid generator to make this name, MySemaphore88c1f6a9-e063-4e5c-8161-c824ac987896 then no other generated guid should produce the part after MySemaphore. I just stuck MySemaphore on there because kernel object names, iirc, are not supposed to start with a number but a character.
      My System SpecsSystem Spec

  6. #5


    Posts : 1,875
    Windows 10 Pro Prieview x64


    OK thanks - I was thinking of the HDD GUID which you have to change for VMs. This is more like a random number generator for the strings we see in DCOM etc then if I understand you correctly.

    EDIT: I am a programmer actually but on IBM i not windows. There you make up names for objects and are confined to 10 characters and only one directory level (well sort of). Guess what - you do get duplicates. Think how many programmers when writing a payroll program and confined to 10 characters will call it "PAYROLL". Almost all of them do.
      My System SpecsSystem Spec

  7. #6


    Posts : 2,130
    Windows 8.0 x64


    Yeah, Guid was created for COM/DCOM stuff. Depending how they are used sometimes they are called CLSID or whatnot. ActiveX is a good example. In Windows there's an associative array object for scripting named Scripting.Dictionary. But in the registry the name is associated with a CLSID.

    And yeah I can believe over 90% named it PAYROLL. That's like the old unix linkers that only had 6 character names. Linux is still burdened with the short program names for standard commands as a legacy.
      My System SpecsSystem Spec

  8. #7


    Posts : 308
    64-bit Windows 8


    Is there a way to assign a GUID to an existing object, such as a folder?
      My System SpecsSystem Spec

  9. #8


    Posts : 22,573
    64-bit Windows 10


    Hello Dragon Drop,

    Yes, you could assign a GUID to open a folder when referenced. For example, you would reference the GUID when adding a folder or item to This PC or Control Panel.

    What did you have in mind?
      My System SpecsSystem Spec

  10. #9


    Posts : 308
    64-bit Windows 8


    I mean, if I've created a new GUID and I want it to represent a certain folder, how do I TELL Windows which folder I want it to represent? Do I have to create a new Registry key or something?
      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
GUID - Generate in Windows
Related Threads
How to Generate and View a System Health Report in Windows 8.1 A System Diagnostics Report, also called a System Health Report, details the status of local hardware resources, system response times, and processes on the local computer along with system information and configuration data. This...
CLSID Key (GUID) Shortcuts List for Windows 8 and 8.1 A CLSID is a globally unique identifier that identifies a COM class object. For more information about a CLSID key and the function of it's subkeys in the registry, then see CLSID Key (COM). This is a list of GUIDs from the CLSID key in...
When you try to delete WLM messages you get this error "An unknown error has occurred" and the message cannot be deleted. People with this problem, often need to delete multiple messages or entire folders. That error appears because WLM only thinks it has that/those message(s), but actually...
How to Generate a Battery Usage Report in Windows 8 and 8.1 The Windows 8 battery usage report will help you to know more about the usage, health, and life estimates of your system's battery. This tutorial will show you how to generate a detailed battery usage report for your Windows 8,...
How to Generate and View a System Performance Report in Windows A System Performance Report details the status of local hardware resources, system response times, and processes on the local computer. You can use this information to identify possible causes of performance issues. This...
Since apparently they removed the Performance and Information Tools section of the Windows 8.1 Control Panel, I haven't been able to find a way to generate a System Health Report. Anyone got a good guide on how to generate one? Or did they remove the capability of generating one? I know I had one...
How to Generate a Sleep Study Diagnostic Report in Windows 8.1 Sleep Study is a new tool available on Windows 8.1 and newer systems supporting InstantGo (previous to Windows 8.1, this was called "Connected Standby") that can help you identify sources of battery drain that occurred while the PC...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook