2

How would I get this code to store the value returned by uuidgen.exe? I want the value of guid to be a Guid, not the path to uuidgen.exe.

SET guid="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\uuidgen.exe"
ECHO %guid%
pause
gwin003
  • 7,432
  • 5
  • 38
  • 59

1 Answers1

4

In a batch file you need the double percent sign on your variables, and to properly quote the path to uuidgen.exe. The following works in a batch file on my local computer (note the different version of SDK)

for /f %%i in ('"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\uuidgen.exe"') do set guid=%%i
echo %guid%
mocj
  • 1,456
  • 1
  • 9
  • 9