(1) You don't actually need a separate file. It's just that my PC is not on a LAN so i could not just use the output of the command directly. This is how you could do that (note single quotes)
for /f "delims==" %%L in ('net config rdr ^| find " NetBT_Tcpip"') do (
commands
)
(2) Do you need just the hex string or do you want the curly brackets ("braces" in America, I believe) as well?
If the string eg
NetBT_Tcpip_{2FF4CC67-D07D-4FEB-85FD-860B1254C849} (00C0A8C16B59)
is always a fixed length, you can just select so many characters from the string (first char is position 0)
(with curly brackets) the 38 characters starting at position 20
set address=%chosenadaptor:~20,38%
(without curly brackets) the 36 characters starting at position 21
set address=%chosenadaptor:~21,36%
Or, parse out the chars in between the curly brackets (they will be the second token) with FOR
add these lines to the end of my above batch to see what I mean
REM parse out address
echo method (1)
echo address with curly brackets is %chosenadaptor:~20,38%
echo address without curly brackets is %chosenadaptor:~21,36%
echo method (2)
for /F "delims={} tokens=1,2" %%A in ("%chosenadaptor%") do set address=%%B
echo address with curly brackets is {%address%}
echo address without curly brackets is %address%
method (1)
address with curly brackets is {45CF33C4-A270-4E9F-945F-C9FB6E1B0875}
address without curly brackets is 45CF33C4-A270-4E9F-945F-C9FB6E1B0875
method (2)
address with curly brackets is {45CF33C4-A270-4E9F-945F-C9FB6E1B0875}
address without curly brackets is 45CF33C4-A270-4E9F-945F-C9FB6E1B0875