2
I reduced the code to be brief:
@echo off
setlocal EnableDelayedExpansion
set /a n_tokens=2
for /f "tokens=!n_tokens! delims=\" %%s in ("Program\Executable") do (
echo %%s
)
pause > nul
I know that in this context it would not be necessary to use exclamations (!!) to expand the variable, but in the context that I need is.
When using the delayed Expansion I get the error "tokens=! n_tokens! was unexpected", I wonder what is the problem that happens and some solution too.