问题描述
当您在网络连接上单击修复"时,是否有人确切知道Windows XP会做什么?我想以编程方式或从命令行执行相同的操作.
Does anyone know exactly what Windows XP does when you click "Repair" on a network connection? I'd like to do the same programmatically or from a command line.
我进行了一次Google搜索,发现这篇文章,有很好的解释,但我认为它并不完整.我可以可靠地重现失去网络连接的情况,然后单击修复"按钮可以解决问题,但是运行该文章中的命令则不能.
I did a Google search and found this article, which has a good explanation, but I don't think it's complete. I can reliably reproduce a condition where I lose network connectivity and clicking the Repair button fixes the problem, but running the commands in that article does not.
推荐答案
谢谢,伙计们,我想我明白了.由lpfavreau发布的 MS KB文章中的步骤几乎是 完成.那就是我尝试过的方法,但是没有用.但是,如果我先执行ipconfig /release
,那么它似乎可以工作.我怀疑修复"按钮会在没有明确记录的情况下执行此操作.对于我的特殊情况,我还必须清除路由("route -f").因此,我最终运行的命令是:
Thanks, guys, I think I figured it out. The steps in the MS KB article posted by lpfavreau are almost complete. That's what I tried and it didn't work. However, if I do ipconfig /release
first then it seems to work. I suspect that the "Repair" button does that without it being explicitly documented. For my particular case I also had to clear the routes ("route -f"). So, the commands I ended up running in the end are:
route -f
ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
ipconfig /flushdns
ipconfig /registerdns
我还找到了一些C代码来调用实际的修复连接"功能,尽管我尚未对其进行测试-在此处查看最新帖子.
I also found some C code to call the actual "Repair Connections" functionality, though I haven't tested it - see last post here.
这篇关于“修复"以编程方式/从命令行进行网络连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!