China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-29 09:02
中国DOS联盟论坛 » 论坛回收站 » Please provide the specific content that needs to be translated and have the script details so that I can help you translate it. View 1,811 Replies 0
Original Poster Posted 2009-06-23 08:11 ·  中国 广东 深圳 电信
初级用户
Credits 33
Posts 30
Joined 2009-02-19 09:47
17-year member
UID 139249
Gender Male
Status Offline
What I want to implement is: Find whether the size of the hots file of each computer is the specified size. If it is, record the computer name; if not, do not record.

Now I have a txt file, and each line in it is a computer name. Suppose there are 100 lines, that is, 100 computers.

First, I want to use the for command to grab the computer names in the TXT file and save them to a variable, and then implement the automatic mapping net use K: \\computer name\c$\windows\system32\etc

(Because I don't know how to extract it very well, I don't know how to use the for command)

Judge whether the mapping is successful. If it is not successful, assign the value N to a variable.

If it is successful, continue to perform the following operations.
dir K:\hots >> d:\1.txt (view the information of the hots file and record it to the 1.txt file)
Then use for again to analyze the file size part in the txt text. If the size of the HOTS file is 750K, record the computer name.

In the end, a text is generated. The format of this text is

Computer (this only shows the computer name, indicating that the size of the hots file is the size to be compared)
Computer name, N (this means that the mapping of the computer is not successful)

> and >> are used, just one overwrites and the other appends.



Please help me write this batch processing. Thank you!
Forum Jump: