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-07-31 22:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Modify the name of the local connection View 3,643 Replies 4
Original Poster Posted 2006-12-10 01:28 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
for /f "usebackq tokens=3 delims= " %%i in (`netsh interface show interface^|find "专用"`) do (
set a=%%i
if #%%i neq #本地连接 netsh interface set interface name=%%i newname=本地连接
)
pause
Rename the local connection

[ Last edited by a9319751 on 2006-12-12 at 06:58 AM ]
bat c c++
Floor 2 Posted 2006-12-10 01:43 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  The set a=%%i here seems a bit redundant, and so is delims=.

  Modify it:

@echo off&&for /f "tokens=3" %%i in ('netsh interface show interface^|find "专用"') do if #%%i neq #本地连接 netsh interface set interface name=%%i newname=本地连接
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
a9319751 +2 2006-12-10 02:31
Floor 3 Posted 2006-12-10 01:46 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
bat c c++
Floor 4 Posted 2006-12-20 23:16 ·  中国 广东 深圳 电信
初级用户
Credits 83
Posts 35
Joined 2006-10-30 14:47
19-year member
UID 68886
Gender Male
From 广东
Status Offline
Learning
Floor 5 Posted 2010-03-25 17:55 ·  中国 福建 厦门 电信
新手上路
Credits 9
Posts 4
Joined 2009-08-20 15:40
16-year member
UID 150698
Gender Male
Status Offline
It seems it didn't work.
Forum Jump: