China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 18:43
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Solved] How to get the local connection name of a specified network card View 1,468 Replies 2
Original Poster Posted 2007-09-20 16:38 ·  中国 广东 惠州 电信
初级用户
Credits 20
Posts 7
Joined 2006-06-03 21:10
20-year member
UID 56497
Gender Male
Status Offline
Instructions:
Adding a new Microsoft Loopback Adapter loopback network card in the computer will add a new local connection. I originally wanted to configure a specified IP for this new connection, but because the name of the local connection generated by each computer is different, the netsh command cannot be used to wildcard the IP (the netsh command needs to specify the local connection name).

For example: netsh interface ip set address name="Local Area Connection X" static 192.168.0.100 255.255.255.0

Difficulty: The name of the local connection of the newly added network card cannot be determined, but the network card is fixed: Microsoft Loopback Adapter

Requirement: Be able to use the netsh command to specify an IP for the newly added network card

I couldn't solve it by searching for information. I hope the experts can give guidance. I am very grateful~

[ Last edited by mpl2005 on 2007-9-20 at 09:57 PM ]
Floor 2 Posted 2007-09-20 21:59 ·  中国 广东 惠州 电信
初级用户
Credits 20
Posts 7
Joined 2006-06-03 21:10
20-year member
UID 56497
Gender Male
Status Offline
Just now, I asked an expert in the forum, and the solution code is as follows:

FOR /F "tokens=2*" %%i IN ('ipconfig/all^|find /i "Ethernet adapter "') DO set name=%%j

The variable name is

But I don't understand it. Could any expert explain the detailed process? Only by knowing the reason can there be progress, right~
Floor 3 Posted 2008-09-05 15:21 ·  中国 广东 中山 电信
新手上路
Credits 2
Posts 1
Joined 2008-09-05 14:58
17-year member
UID 124866
Gender Male
Status Offline
My computer's Local Area Connection is missing. I've looked at the above prompts. Can it really be retrieved?
Forum Jump: