Generate GUID in Windows with batch file

Pratik picture Pratik · Nov 30, 2010 · Viewed 62k times · Source

How can I generate a GUID in a batch file running using the commandline in Windows?

Answer

Tim Robinson picture Tim Robinson · Nov 30, 2010

The Windows SDK comes with a tool called uuidgen (if you have Visual Studio, you'll have the Windows SDK, and you need to run the Visual Studio Command Prompt to set proper paths).

C:\>uuidgen

This will output a new GUID, e.g.

cc23b318-156e-473f-aa6e-517bf091a0f0