现有个配置文件cf.ini,要修改其中间一行的参数,想通过批理获取的ip附加到
HostRestrictions=192.168.1.5\/12.13.2.16 IP间的\/开(不是字母V,是正反斜杆)。最新的IP是由for /f "tokens=15 skip=1" %%i in ('ipconfig ^| find /i "ip address"') do set ip2=%%iCOPY 获取%ip2%的值。
配置文件内容格式如下,(HostRestrictions字符串在整个文件中两次存在此,HostRestrictionsAllow)
......
[Access filtering]
HostRestrictions=192.168.1.5\/12.13.2.16 要改成HostRestrictions=192.168.1.5\/56.123.22.28
HostRestrictionsAllow=1
...... | | | sed -i "s/HostRestrictions=192\.168\.1\.5....../HostRestrictions=192\.168\.1\.5\\\/56\.123\.22\.28/" c:\bat\cf.iniCOPY |
运行提示:
The system cannot execute the specified program.,没更改成功
[ 本帖最后由 qwertl 于 2009-12-19 22:26 编辑 ] |