Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to generate a Universal Unique Identifier or Global Unique Identifier (UUID or GUID) in a Windows shell script? Linux / Unix / Mac OS X have the bin utility uuidgen and I'm curious if Windows has an equivalent. Thanks!

share|improve this question
up vote 1 down vote accepted

There is an eponymous Windows port of uuidgen available with Visual Studio.

Documentation is here and here.

share|improve this answer
Thanks for the answer! I don't have a copy of Visual Studio. Do you know if a universal binary is available for this? Thanks! – Kevin Sylvestre Dec 24 '10 at 1:09
Visual Studio Express Edition is free and can be downloaded from Microsoft. You could then pull out the specific files you need. – nhinkle Dec 24 '10 at 1:15
Sorry for all the questions (I don't use Windows as my main OS). Will I be able to package the identifier such that users downloading my script won't require installation of Visual Studio? If not it isn't really an option. Thanks! – Kevin Sylvestre Dec 24 '10 at 1:25
s/eponymous/homonymous/ ;) – Clément Apr 30 '13 at 13:47

If you're using PowerShell it's very easy:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\Jeff> $guid = [guid]::NewGuid()
PS C:\Users\Jeff> $guid

share|improve this answer
Cool, thanks Jeff! – Kevin Sylvestre Dec 25 '10 at 14:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.