| 
 
caucfeiyu 
初级用户
 
  
 
  
 
积分 108 
发帖 35 
注册 2007-4-12 来自 河北廊坊 
状态 离线
 | 
『楼 主』:
 for中用~na是什么意思?
 
使用 LLM 解释/回答一下
  
请问在for /r g:\mp3 %a in (*.mp3) do @echo %~na中%~na是什么意思啊! 
在for /?帮助里: 
%~I 展开删除任何前后引号 ("") 的 %I。  
%~fI 将 %I 展开到完全合格的路径名。  
%~dI 只将 %I 展开到驱动器号。  
%~pI 只将 %I 展开到路径。  
%~nI 只将 %I 展开到文件名。  
%~xI 只将 %I 展开到文件扩展名。  
%~sI 展开路径以只包含短名称。  
%~aI 将 %I 展开到文件的文件属性。  
%~tI 将 %I 展开到文件的日期和时间。  
%~zI 将 %I 展开到文件大小。  
这里将%I展开到完全合格的路径名,只将%I展开到驱动器号,是什么意思啊,不太理解它这里说的是什么意思,请举一个例子解释一下好吗? 
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? 
    
 
  
 |   
 | 
  2007-4-14 12:36 | 
  
 | 
 | 
 
bjsh 
银牌会员
 
     
 
  
  
积分 2000 
发帖 621 
注册 2007-1-1 
状态 离线
 | 
『第 2 楼』:
 
 
使用 LLM 解释/回答一下
  
上面不写这了吗> 
 
展开到文件名; 
 
比如你g:\mp3中有个test.mp3 
 
如果只是 echo %a 回显为 g:\mp3\test.mp3 
 
如果echo %~na 回显则为 test 
 
只有文件名而已 
Isn't it written above? 
 
Expand to the file name; 
 
For example, there is a test.mp3 in g:\mp3 
 
If you just echo %a, it will echo as g:\mp3\test.mp3 
 
If you echo %~na, it will echo as test 
 
Only the file name itself 
    
 
  
 |   
 | 
  2007-4-14 21:27 | 
  
 | 
 | 
 
htysm 
高级用户
 
    
 
  
 
积分 866 
发帖 415 
注册 2005-12-4 
状态 离线
 | 
『第 3 楼』:
 
 
使用 LLM 解释/回答一下
  
@echo off 
:: echo 请将这个批处理放在桌面上运行。 
echo 这个批处理展开到完全合格的路径名是:%~f0 
echo 这个批处理展开到驱动器号是:%~d0 
pause>nul 
@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 
    
 
  
 |   
 | 
  2007-4-14 21:55 | 
  
 | 
 | 
 
caucfeiyu 
初级用户
 
  
 
  
 
积分 108 
发帖 35 
注册 2007-4-12 来自 河北廊坊 
状态 离线
 | 
『第 4 楼』:
 
 
使用 LLM 解释/回答一下
  
谢谢各位了,明白了! 
去过这么多论坛,还是这里最好啊! 
有人情味啊!哈哈~!~!~! 
Thanks everyone, got it! 
Been to so many forums, but this one is the best! 
It has a human touch! Haha~!~!~! 
    
 
  
 |   
 | 
  2007-4-14 23:13 | 
  
 | 
 | 
 
tongwandou 
初级用户
 
  
 
  
  
积分 112 
发帖 50 
注册 2007-4-15 
状态 离线
 | 
 | 
  2007-4-15 04:58 | 
  
 | 
 | 
 
jackson313 
初级用户
 
  
 
  
  
积分 48 
发帖 26 
注册 2007-4-9 
状态 离线
 | 
 | 
  2007-4-15 14:41 | 
  
 | 
 | 
 
minmin888 
初级用户
 
  
 
  
  
积分 127 
发帖 62 
注册 2007-4-19 
状态 离线
 | 
 | 
  2007-4-21 09:54 | 
  
 | 
 | 
 
fdasf 
新手上路
 
 
 
  
  
积分 2 
发帖 1 
注册 2007-4-21 
状态 离线
 | 
 | 
  2007-4-22 00:00 | 
  
 | 
 | 
 
haiou327 
高级用户
 
      DOS时空
  
 
积分 713 
发帖 348 
注册 2007-2-10 
状态 离线
 | 
 | 
  2008-1-5 17:13 | 
  
 | 
 | 
 
DarksKy1984 
初级用户
 
  
 
  
  
积分 46 
发帖 24 
注册 2008-1-4 
状态 离线
 | 
 | 
  2008-1-7 19:41 | 
  
 |