Yo lo haria asi:
Código [Seleccionar]
@echo off
setlocal enabledelayedexpansion
set v=23
set charmap=TRWAGMYFPDXBNJZSQVHLCKE
set /p "DNI=Introduce tu DNI: "
set /a "r=%DNI%%%v%"
echo NIF:%DNI%!charmap:~%r%,1!