VB (but applies to all) - BEST way to disconnect internet connection
After searching for hours to find the perfect way to solve this problem, I thought to myself "Why not just do it through the command prompt? Everything works better in there". So here it is:
VB Code:
RunCommand "RasDial /DISCONNECT"
I have attached the module including the code used to run Command Prompt commands in VB.
Reason why I think this is the best:
I have seen the other APIs like AutoDialHangup and all of that, but I think this way is the best because you don't have to create the connection with any extra code in order to close it. This works every time, with any kind of dialup connection.
I used this do disconnect a shared internet connection (LAN) where the host had a dialup connection, and both computers ran WindowsXP.
As far as I know, RASDIAL is built in to Windows XP (and probabaly earlier versions) - so this should work on any computer.
***I THINK***
"ipconfig /release" won't hangup a dialup internet connection. It just resets some kind of setting that I don't know anything about, and a restart is required for this to take effect anyway.
************
So, Jhd.Honza:
"RasDial /DISCONNECT" should be the command that hangs up your connection, otherwise I have no idea why this isn't working for you