Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 108 Posts 35 Joined 2007-04-12 15:23 19-year member UID 84897 Gender Male From 河北廊坊
Status Offline
What does %~na mean in "for /r g:\mp3 %a in (*.mp3) do @echo %~na"?
In the for /? help:
%~I expands %I by removing any surrounding quotes ("").
%~fI expands %I to the fully qualified pathname.
%~dI expands %I to just the drive letter.
%~pI expands %I to just the path.
%~nI expands %I to just the file name.
%~xI expands %I to just the file extension.
%~sI expands the path to only contain the short name.
%~aI expands %I to the file attributes of the file.
%~tI expands %I to the date and time of the file.
%~zI expands %I to the file size.
Here it says "expands %I to the fully qualified pathname" and "expands %I to just the drive letter", what does this mean? I don't quite understand. Can you give an example to explain it?
Credits 866 Posts 415 Joined 2005-12-04 11:19 20-year member UID 46459
Status Offline
@echo off
:: Please place this batch file on the desktop and run it.
echo The fully qualified pathname of this batch file is: %~f0
echo The drive letter of this batch file is: %~d0
pause>nul