Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I need an idea on how can i Disable IPv6 on a user’s system without getting the system restarted. Winform C#  as i said that this will be client machine and client can use any version of the windows .

The main thing is i am looking for a solution to achieve this on windows and without restarting the system.


What I have tried:

I tried it using CMD netsh command but it needs reboot.
Posted
Updated 5-Jan-19 6:00am
Comments
F-ES Sitecore 2-Feb-18 9:09am    
You're probably trying to solve the wrong problem. If you explain why you want to disable IPv6 someone might be able to provide an alternative solution.

 
Share this answer
 
Comments
Ahsan Shaikh 2-Feb-18 7:42am    
this link is sharing information specifically for windows vista . i am looking for ny idea that is not version specific
Because you want to do it on systems with different Windows versions, using netsh is the best option. Otherwise, you would have to write Windows version dependant code to change the network configuration while the netsh from the Windows version will always work as expected.

The problem is that there are many services affected by changing network interface settings. You have to know all these services and restart them. Because detecting those services is nearly impossible (especially when there are 3rd party services), a reboot is the recomended action to avoid unwanted side effects.

If you still want to try it, have a look at this SE thread: cmd.exe - Windows 7 'netsh reset' without rebooting? - Super User[^]. That is for Windows 7. So you have to create a similar list for each Windows version that must be supported.
 
Share this answer
 
You can stop IP6 by un-checking it on the network adapter configuration panel of any Windows version and follow up by simply pressing the "OK" button, all the traffic seems to halt with no issue, so why can't that be done programmatically and without requiring a reboot?

Otherwise every answer I've seen online regarding this topic says you can only do it with a reboot after issuing one of these commands which all in effect I believe altering the registry and then rebooting. I read even one suggestion of changing the registry and then stopping and re-starting all network services to avoid the re-boot requirement, which first of all did not work for me and secondly requires several minutes and a lot of screen output to execute.

Unverified suggestions for turning off IP6 in Windows which will only take effect after a reboot:

ref1 random online post:

netsh interface teredo set state disable
netsh interface 6to4 set state disabled
netsh interface isatap set state disabled

ref2 random online post:

netsh interface teredo set state disabled
netsh interface ipv6 6to4 set state state=disabled undoonstop=disabled
netsh interface ipv6 isatap set state state=disabled

ref3 random online post:

(setting it off)
reg add HKLM\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters /v DisabledComponents /t REG_DWORD /d 255 /f

or creating a xxxx.reg to set it off

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters]
"DisabledComponents"=dword:000000FF

(or setting it back on)

reg add HKLM\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters /v DisabledComponents /t REG_DWORD /d 00000000 /f

or creating a xxxx.reg to set it on

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters]
"DisabledComponents"=dword:00000000

.... all of these which require a reboot which is completely opposite of what I am the original poster are looking for.

.... still hoping for other suggestions as to how to solve
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900