中国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-12 07:55
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » Ask DOS experts, come and take a look
Printable Version  2,323 / 3
Floor1 min2nan Posted 2011-01-05 13:06
新手上路 Posts 2 Credits 6
In DOS, if you want to create a folder with the name "WDCWD1600AAJS-00B4A0" based on the content in a txt document where that part is in the "Model" line, you can do the following steps:

First, you need to extract the model name from the txt file. Assuming the txt file is named "diskinfo.txt", you can use a batch script to do this. Here is a simple batch script example:

```batch
@echo off
for /f "tokens=2 delims=: " %%a in (diskinfo.txt) do (
if "%%a"=="Model" (
set model=%%b
md "!model!"
goto :end
)
)
:end
```

You can save the above code as a `.bat` file, put it in the same directory as the `diskinfo.txt` file, and then run it. This script will find the line with "Model" in the `diskinfo.txt` file, extract the model name, and create a folder with that name.

Please note that this is a basic example, and you may need to adjust it according to the actual situation.

[ Last edited by min2nan on 2011-1-5 at 19:50 ]
Floor2 netstata1 Posted 2011-01-05 15:54
新手上路 Posts 2 Credits 4
Direct MD C:\WDCWD1600AAJS-00B4A0
Floor3 YSY19891128 Posted 2011-01-20 12:32
新手上路 Posts 6 Credits 11
Not clear! Just started learning not long ago
Floor4 yangdao Posted 2012-12-07 22:08
新手上路 Posts 5 Credits 12
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023