中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-25 23:17
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS批处理 & 脚本技术(批处理室) » A bug in the short filename extension of the for expansion
Printable Version  2,891 / 9
Floor1 namejm Posted 2007-01-24 23:24
荣誉版主 Posts 1,737 Credits 5,226 From 成都
In the for expansion, %%~si means the expanded path contains only the short file name. But in the following test process, it was found that the actual situation is not the case:

Test environment:


Test code:


Test result:


Did you see the last record of the test result? It actually expanded to TEST~1.TXTtxt!

Summarizing the error situation, it seems that when there are more than one places in the path where the directory name is expanded to a short file name because it exceeds 11 characters, a file with a file name + suffix name less than 11 characters and with spaces will have an expansion error. I wonder if someone can make a deep analysis.

[ Last edited by namejm on 2007-1-24 at 02:22 PM ]
Floor2 fastslz Posted 2007-01-25 00:07
铂金会员 Posts 2,315 Credits 5,493 From 上海
I have experienced this bug before
Floor3 lxmxn Posted 2007-01-25 00:47
版主 Posts 4,938 Credits 11,386

  Hehe, it turns out it's like this.
Floor4 xuduo Posted 2007-01-30 16:12
初级用户 Posts 9 Credits 20
Floor5 NaturalJ0 Posted 2007-01-30 21:16
银牌会员 Posts 533 Credits 1,181
Haven't encountered it yet, just in time to learn. ^_^
Floor6 anqing Posted 2007-02-08 22:40
高级用户 Posts 413 Credits 859
Got it, learned something
Floor7 zqz0012005 Posted 2007-03-08 16:16
中级用户 Posts 135 Credits 297
It's not like you said, because spaces are not allowed in the short names of files/folders that contain spaces. This is not a bug of for.
Floor8 taozicici Posted 2007-05-01 01:34
新手上路 Posts 6 Credits 12
Dizzy
Completely don't understand
It seems that I will have to spend 18 hours a day on the forum in the future
Floor9 everest79 Posted 2007-05-01 03:44
金牌会员 Posts 1,127 Credits 2,564
In the command specification of 8.3, spaces are not allowed, so when extending the long name to the short name, the spaces are automatically indented
Floor10 ccuu668 Posted 2007-05-02 15:36
初级用户 Posts 29 Credits 57
It seems I can only educate myself more. Sigh! There are really so many experts and masters here.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023