Is there any way to use the for instruction to analyze the byte part in 1.txt after I use dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt.
Example:
I first use dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt to generate a 1.txt. The content of this text is as follows.
-----------
The volume in drive C has no label.
The serial number of the volume is 2C10-E32D
Directory of c:\windows\system32\drivers\etc
2003-03-03 23:23 730 hosts
1 file 730 bytes
0 directories 2,955,378,688 available bytes
---------------------
Now I need to use the for instruction to read the value 730 in 730 bytes and assign the value 730 to a variable. But I use for,/f,"skip=6 tokens=1,2,*",%%a in (d:\1.txt) do @each %%a>d:\2.txt
There seems to be a problem. And there are 2 lines after 730 bytes, how to shield the following 2 lines..
I just want to get the value 730, and then compare whether it is equal to the value I want.. How to do it?
Example:
I first use dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt to generate a 1.txt. The content of this text is as follows.
-----------
The volume in drive C has no label.
The serial number of the volume is 2C10-E32D
Directory of c:\windows\system32\drivers\etc
2003-03-03 23:23 730 hosts
1 file 730 bytes
0 directories 2,955,378,688 available bytes
---------------------
Now I need to use the for instruction to read the value 730 in 730 bytes and assign the value 730 to a variable. But I use for,/f,"skip=6 tokens=1,2,*",%%a in (d:\1.txt) do @each %%a>d:\2.txt
There seems to be a problem. And there are 2 lines after 730 bytes, how to shield the following 2 lines..
I just want to get the value 730, and then compare whether it is equal to the value I want.. How to do it?
