Board logo

标题: 我想用IPCONFIG /ALL列出IP,网关等值,然后将这二个值赋给AAA和BBB [打印本页]

作者: 024024     时间: 2006-3-30 08:56    标题: 我想用IPCONFIG /ALL列出IP,网关等值,然后将这二个值赋给AAA和BBB
我想用IPCONFIG /ALL列出IP,网关等值,
然后将这二个值赋给AAA和BBB.
应该什么写?

作者: 3742668     时间: 2006-3-30 09:39
for /f "delims=: tokens=2" %i in ('"ipconfig | find /i "ip address""') do set ip=%i
for /f "delims=: tokens=2" %i in ('"ipconfig | find /i "default gateway""') do set gateway=%i
若应用到批处理中需把%i更改为%%i

作者: 024024     时间: 2006-3-30 20:26
Originally posted by 3742668 at 2006-3-30 09:39:
for /f "delims=: tokens=2" %i in ('"ipconfig | find /i "ip address""') do set ip=%i
for /f "delims=: tokens=2" %i in ('"ipconfig | find /i "defaul ...


thinks you.

作者: JonePeng     时间: 2006-3-31 00:09
Originally posted by 024024 at 2006-3-30 20:26:
thinks you.

你在想念他呀?
应该是Thank you,又是笔误。:D