按照2楼的说法,其实就是批处理语法太混乱,( 只跟最近的一个 ) 相结合。——但是for的嵌套 () 为什么没出现这种规律?
所以代码这么修改也行:- @echo off
- (echo # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
- echo #
- echo # This file contains the mappings of IP addresses to host names. Each
- echo # entry should be kept on an individual line. The IP address should
- echo # be placed in the first column followed by the corresponding host name.
- echo # The IP address and the host name should be separated by at least one
- echo # space.
- echo #
- echo # Additionally, comments (such as these^) may be inserted on individual
- echo # lines or following the machine name denoted by a '#' symbol.
- echo # For example:
- echo #
- echo # 102.54.94.97 rhino.acme.com # source server
- echo # 38.25.63.10 x.acme.com # x client host
- echo 127.0.0.1 localhost ) >11.txt
- pause >nul
复制代码
echo # Additionally, comments (such as these^) may be inserted on individual |