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!
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!
