|Please, see this simple code:|
for /f "tokens=* delims=" %%a in ('dir /b /a-d c:\' ) do (
The output is:
- %%a = all filenames in c:\
- %%~pa = current path name (diferent of c:\ path)
I thought that if %%a = c:\filename, then %%~pa should de c:
For some reasons I dont want to use PUSHD to get path name, one of these reasons is that in my real bat the input format to path name is pretty variable (it saves typing but raises difficulty to handle).
Is there any way of making %%~pa to express the real path of %%a? I could solve this in another way, with a few lines of string manipulation, but I am wondering whether there is another simple sintax resource that I am missing.
Thank any enlightening.