|
alfredhou
初级用户
 
积分 100
发帖 34
注册 2006-4-5
状态 离线
|
 『楼 主』:
关于用批处理直接修改网关
使用 LLM 解释/回答一下
能否用批处理直接修改XP系统的网关?在CDM中手动输入NETSH再一步一步输入命令可以.但批处理就想不出怎么做.而且,我需要的是IP不变,只变网关.请教各位有好办法吗?
先谢啦
Can batch processing directly modify the gateway of the XP system? It can be done by manually entering NETSH in the CMD and then entering commands step by step. But I can't figure out how to do it in batch processing. Moreover, I need the IP to remain unchanged and only the gateway to be changed. I ask you all, is there a good way? Thanks in advance
|
|
2006-6-16 10:43 |
|
|
kingljp
初级用户
 
积分 80
发帖 29
注册 2006-5-3
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
小伙子,发贴也不看地方。
到论坛里搜一下吧,以前我回答过这个问题
Young man, you didn't post in the right place. Search the forum, I answered this question before.
|
|
2006-6-16 11:04 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
netsh interface ip set address "本地连接" static IP地址 子网掩码 默认网关 1
netsh interface ip set address "Local Area Connection" static IP address subnet mask default gateway 1
|
|
2006-6-16 11:11 |
|
|
alfredhou
初级用户
 
积分 100
发帖 34
注册 2006-4-5
状态 离线
|
『第 4 楼』:
关于修改网关
使用 LLM 解释/回答一下
大哥,我搜过啦.也看了,但不怎么行呀.
netsh interface ip set address是要边IP也改啦.现在的总是是我事先不能确定到时侯运行这个批处理的那台机器的IP是什么呀,而且我不能改了它的IP,只能改它的网关.
我自己有个思路,用IPCONFIG/ALL >1.TXT配合FINDSTR用找出IP然后再用NETSH但自己却无法实现这个思路.请大家多给意见.
谢谢
Dude, I've searched and read, but it's not really working out.
netsh interface ip set address is for changing the IP. Now the problem is I can't pre - determine what the IP of the machine running this batch at that time will be, and I can't change its IP, only its gateway.
I have an idea myself, using IPCONFIG/ALL >1.TXT combined with FINDSTR to find the IP and then using NETSH, but I can't make this idea work. Please give more advice.
Thanks
|
|
2006-6-16 11:15 |
|
|
bagpipe
银牌会员
     DOS联盟捡破烂的
积分 1144
发帖 425
注册 2005-10-20 来自 北京
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
for /f "tokens=2 delims=:" %%i in ('"ipconfig|findstr /I /c:"ip address""') do set a=%%i
这样不就可以了吗?
for /f "tokens=2 delims=:" %%i in ('"ipconfig|findstr /I /c:"ip address""') do set a=%%i
Isn't this okay?
|
|
2006-6-16 13:15 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
───────────────── 版务记录 ─────────────────
执行:Will Sort
操作:移动主题:自 DOS疑難解答 & 問題討論(解答室)
说明:依照主题内容分类,更适合于发表在此版区
处罚:扣除因发表该主题而奖励的6点积分,版区违规惩罚性扣除2点积分
───────────────── 版务记录 ─────────────────
───────────────── Moderation Log ─────────────────
Performed by: Will Sort
Action: Move Topic: From DOS Troubleshooting & Discussion (Help Desk)
Explanation: According to the topic content classification, it is more suitable to be posted in this forum area
Punishment: Deducted 6 points of rewards for posting this topic, and 2 points of points deducted for forum area violations
───────────────── Moderation Log ─────────────────
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2006-6-17 15:26 |
|
|
senffon
初级用户
 
积分 118
发帖 66
注册 2005-10-21
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
@echo off
color 0b
echo.
echo.
echo. ==============================================================
echo.
echo.
echo. 为了优化近段时间的上网质量,本网吧对上网线路作出相应调整!
echo.
set /p var= 请按任一键开始切换!
echo.
echo. ==============================================================
echo.
echo.
echo. 正在为你更换较快的线路,请稍候 ........
echo. .............................................................
netsh i i set address name="本地连接" gateway=192.168.0.254 gwmetric=0
@echo off
color 0b
echo.
echo.
echo. ==============================================================
echo.
echo.
echo. In order to optimize the online quality in recent days, this internet cafe has made corresponding adjustments to the online line!
set /p var= Please press any key to start switching!
echo.
echo. ==============================================================
echo.
echo.
echo. Changing to a faster line for you, please wait ........
echo. .............................................................
netsh i i set address name="Local Area Connection" gateway=192.168.0.254 gwmetric=0
|
|
2006-6-19 15:02 |
|