中国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-07 18:59
48,041 topics / 350,128 posts / today 3 new / 48,252 members
DOS批处理 & 脚本技术(批处理室) » Extra characters appear when using copy with long filenames
Printable Version  679 / 1
Floor1 422904z Posted 2008-03-10 22:37
初级用户 Posts 37 Credits 74
@echo off

set /p name=Please enter the filename you want to copy:
COPY i:\%name%.NC i:\b\%name%.NC

EXIT


There is a file on drive I: gce8011713p0101cdxn010091p0101cdxn010097p0101.nc

When entering gce8011713p0101cdxn010091p0101cdxn010097p0101, it runs correctly

But if I enter *13*91*97*1, the result becomes gce8011713p0101cdxn010091p0101cdxn010097p01013.nc91971.NC
It removed the * from *13*91*97*1 and appended it, for some reason. I don't know why. Please can an expert explain!
Floor2 suntb Posted 2008-03-10 22:56
高级用户 Posts 277 Credits 581
@echo off

set /p name=Please enter the filename you want to copy:
COPY "i:\%name%.NC" "i:\b\"

EXIT

[ Last edited by suntb on 2008-3-10 at 10:59 PM ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023