中国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-09 02:23
47,811 topics / 349,895 posts / today 0 new / 48,253 members
DOS批处理 & 脚本技术(批处理室) » Problem encountered with for /f (tokens=) in a batch file
Printable Version  810 / 2
Floor1 a794685135 Posted 2008-06-22 19:31
初级用户 Posts 34 Credits 71
The content in 1.txt is “12”
What I want is to read 12 from 1.txt, then mkdir 1 & mkdir 1\2
Should it be written like this
for /f "tokens=1,2 " %%j in (1.txt) do mkdir %%j & mkdir %%j\%%k

But the result is always just a folder named 12
instead of having a folder 2 inside folder 1

So how exactly should it be written???
Floor2 HAT Posted 2008-06-22 19:45
版主 Posts 5,017 Credits 9,023
Floor3 a794685135 Posted 2008-06-22 20:30
初级用户 Posts 34 Credits 71
Originally posted by HAT at 2008-6-22 07:45 PM:




Thank you very much!!!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023