Setting batch command result to variable
Posted on 2007-11-18
I'm currently exporting the value of a registry key into a text file then using the FIND /C command to retrieve the amount of times a certain string appears. This is my code so far:
REG EXPORT "HKLM\SOFTWARE\National_Australia_Group\GLOBAL\CRM Project\Siebel_ActiveX_Messaging" "C:\Blah.txt"
SET count= FIND /C "INT2.CFG" "C:\Blah.txt"
Whenever I Echo count I only get the complete string. If I use the /A parameter for SET (Used for calculations) it tries to treat it as mathematical.
Any idea how I would get the output of that command rather than just the command in the %count% variable?