Link to home
Start Free TrialLog in
Avatar of RegulaOne
RegulaOne

asked on

What Is The FASTEST & EASIEST Way Or Method To Stop Or Shutdown An Active Internet Connection Through Windows 7?

Hello. I have a question to ask you. I have always wanted to ask this interesting question.

What is the FASTEST & EASIEST way or method  to stop or shutdown an active internet connection (say local area connection) through Windows 7 Professional 64-bit?

More details you may need to know:

1. For "a" home PC LAN Connection (Not an entire home PC network).  
2. Cable modem using a cable Internet service provider.
3. No router in use.
4. Oh, no unplugging or unscrewing the Internet cable too as an answer and solution. :-) Has to be done through the PC. Yes, a software solution I am looking for.

Yes, a simple setup.
 
KEY WORDS: FASTEST & EASIEST

Whether it can be utilizing a component or feature within Windows 7... ...or a third party program installation of sorts that could achieve the fastest and easiest stop or a shutdown.

Please provide your own detailed facts, suggestions, hints, and tips; and/or the best possible well written, detailed and documented website links that SPECIFICALLY describe this process in DETAIL!

DO NOT USE LMGTFY.com or similar-like web links in your reply. I consider its use very unprofessional for EE experts. If you do, you will not get acknowledged and receive no credit.

Please reply.

Thank you!  
ASKER CERTIFIED SOLUTION
Avatar of John
John
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of johnb6767
johnb6767
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just for giggles, here it is.... Stops, and once you hit the ANY key, it restarts them all.....
@echo off
cls
net stop nsi 
echo.
rem Hit any key to restore the network connection....
pause
echo.
net start nsi
echo.
net start Dhcp
echo.
net start Dnscache
echo.
net start iphlpsvc
echo.
net start Netman
echo.
net start NlaSvc
echo.
net start LanmanWorkstation
exit

Open in new window

Avatar of RegulaOne
RegulaOne

ASKER

Hello again. Nice to see you again. I appreciate your dedication. Thank you for your response.

Yes, yours is 'POSSIBLY the fastest and easiest', but johnb6767 has presented one that I think is 'AS fast and easy' as yours. I will need to do some more testing, but at the moment I am having an issue I will next address to johnb6767.

Thank you!

@ johnb6767:

Hello again. It is very nice to see you again! I hope all is okay with you! I always appreciate your dedication! Thank you for your comment.

Okay, the issue I allude to in my remarks to thinkpads_user is that I am getting a message as I execute the CMD file, it states, "System error 5 has occurred.", followed by a statement, "Access is denied.". Please see the attached file below named/titled, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping" for better clarity with this particular issue.

Therefore is there some permissions issues going on here, I am going to assume or something else happening? Please help guide me to the necessary means to correct this "manually" on my Windows 7 system... ...or better yet, if you could modify that batch file script you have attached above in such a way to accommodate this particular issue, so this issue is ultimately corrected 'from the beginning' instead of 'manual' system adjustments and modifications I would have to make, I would appreciate that very much!

Please reply.

Thank you!      
 




    User generated image
@ thinkspad_user:

Hello again. I want to apologize for not posting "at" (@) you on the first line in my post immediately above. Sorry! It was address to you.

Thank you!
The script, Right Click>"Run As Administrator"
@ johnb6767:

Hello. Thank you for your continued time and cooperation in assisting me.

I want to thank you for your latest 'fix' so to speak in your last post to your script. I have moved forward, only to find another set of blockages or 2 more 'stoppages' ("stop control") in process. Both relate to the system response, "System error 1051 has occurred.". Okay, from some knowledge I am aware to resolve the first stoppage especially when the indication is provided in the CMD window. I figured I have to have ALL web browsers closed. Please see embedded below in this comment, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 2". Closing ALL web browsers fixes the first stoppage as I figured, but proceeds to the next stoppage. The second stoppage cannot be determined since the second stoppage does not link to the action that proceeds it in CMD, unlike the first stoppage. The only 'possible' connection is to a preceding servcie as indicated in CMD for "DNS Client service" that NOT stopped. Could this be the service causing the "System error 1051". Any idea what is going on with the second stoppage? Please see embedded below in this comment, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 3".    

It has always been my means to work to the complete conclusion of this particular issue.

Please reply.

Thank you!
 User generated image User generated image
Not sure why the closing the browser affected the first one..... Not the browser you are thinking of...  :-)

Try this from an elevated CMD prompt....

net start Dnscache

Does it stop?

If so, we could add it to the TOP, with a small pause  and then kill the Network Store Interface Service....

@ johnb6767:

Hello again. Thanks for your continue assistance with this particular issue.

I typed your suggested "net start Dnscache" without the quotes in an elevated CMD prompt. It does NOT stop; instead I get the CMD reply, "The requested service has already been started." without the quotes. I then get the following message in CMD stating, "More help is available by typing NET HELPMSG 2182." without the quotes.I go to perform the CMD's requested action I just indicated, "More help is available by typing NET HELPMSG 2182." without the quotes. I again get the same CMD reply, "The requested service has already been started." without the quotes. Please see the attached screen clipping below in embedded this comment, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 4".

Is there any information or clues you can gather from the data and information I have supplied?

Any more suggestions and steps you need to be perform?  

Please reply.

Thank you!

User generated image
Sorry...

net stOP dnscache

It cannot be started and will error if it is running... Im just curious to see if it will stop manually....
@ johnb6767:

Hello again. Thanks for your prompt comment.

I have followed your instructions in your last comment with "net stop dnscache" this time. I was able to stop the DNS Client service. I also turned it back on since it is best to have it running since it is running for default. Please see the attached screen clipping below in embedded this comment, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 5".

Are we now making some progress. What more do you need to know in order to get your script modified in order to work without any issue, short of my understanding that I have to run as administrator or elevated privileges?  

Please reply.

Thank you.  

Stop-Or-Shutdown-An-Active-Inter.PNG
I missed a few services, when I wrote this, as I dont have several of your services enabled....

Lets add an explicit stop to the dnscache BEFORE the nsi service....

Also piped the Y to automatically answer the "Do you want to continue this operation" prompt....
@echo off  
cls  
net stop dnscache
echo.
echo y | net stop nsi   
echo.  
rem Hit any key to restore the network connection....  
pause  
echo.  
net start nsi  
echo.  
net start Dhcp  
echo.  
net start Dnscache  
echo.  
net start iphlpsvc  
echo.  
net start Netman  
echo.  
net start NlaSvc  
echo.  
net start LanmanWorkstation  
echo.
net start HomeGroupProvider
echo.
net start WinHttpAutoProxySvc
echo.
exit

Open in new window

@ johnb6767:

Hello again. Thank you again for your the newest updated script.

Unfortunately, this one also does not stop and shutdown an active internet connection since the Network icon shows no signs of disconnect following the execution of your newly modified script.

I used the "Run as Administrator" or elevated CMD and I captured the entire CMD process for this newly created script. Please see the attached screen clipping below in embedded this comment, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 6". I used the screen capture key on my keyboard while the BAT file was in the process since it closes very rapidly. It is faded CMD screen as I try to capture the CMD screen with ALL the data and information provided. I hope this new information can help you further.

Please reply.

Thank you!  
   User generated image
Grrr..... Lets leave the piped echo into the first one.....
@echo off    
cls    
net stop dnscache  
echo.  
net stop nsi     
echo.    
rem Hit any key to restore the network connection....    
pause    
echo.    
net start nsi    
echo.    
net start Dhcp    
echo.    
net start Dnscache    
echo.    
net start iphlpsvc    
echo.    
net start Netman    
echo.    
net start NlaSvc    
echo.    
net start LanmanWorkstation    
echo.  
net start HomeGroupProvider  
echo.  
net start WinHttpAutoProxySvc  
echo.  
exit

Open in new window

@ johnb6767:

Hello again! Thank you ever so much for your continued help, my friend! ;-)

I absolutely want to thank you for your help with this issue!

Yes, still issues going on here even with elevated/'Run as Administrator". I won't elaborate, just attached the CMD window with the data and information below for your to inspect. I will tell you this, if you wish to throw in the towel (meaning without the cliche: 'give up') at this time and end this, I'll completely understand. I let you off the hook on this one if you would like. You do enough for me! I know!  Your excellent effort will be noted at the conclusion of this thread/question. I promise!

The choice is up to you. Let me know.
 
One question to ask you: I am wondering what operating system you are using on your end with this issue, and if you are testing these scripts on your operating system, and what your results are?

It seems from past accounts in my previous screen clippings in my comments above indicate "Workstation service was stopped successfully." where on this occasion, it was stopped. It seems we cannot win when one is up the other is down per se and vice versa! Stubborn! However, I will say it seems we 'MAY' be getting close?!?!?!?

I am wondering if it is security issues (for protection) with Windows 7 in some way that are preventing the disabling of some of the services that deal with internet connections and networking with the Windows 7 version of Windows?

Yes, Windows XP and earlier was much more 'simpler', 'distinctive' and  'definitive' with its functions I recall without much resistance. I noitced changed with Windows Vista.

Please reply.

Thank you!
 User generated image
@ johnb6767:

Hello again.

...my mistake, in my last comment, where I stated, "It seems from past accounts in my previous screen clippings in my comments above indicate "Workstation service was stopped successfully." where on this occasion, it was stopped." ...should be corrected at the end of this statement, " it was not stopped" obviously. I apologize. My mistake.

Please reply.

Thank you!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ johnb6767:

Hello again! Thank you for your continued effort. I figured you are determined to find the answer and solution! ;-)

Good news, this time it worked successfully running again with an elevated or "Run as Administration"!!! HURRAY!!!  I could see we were getting close if you could find those services that have those dependencies. HOWEVER, this is a ***MUCH BIGGER*** issue happening now that I will get into later in this comment!!!

Okay, the good news is we are able to stop or shutdown an active internet connection during the first segment when running the script in CMD. Please see the embedded attachment below, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 8" & "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 9".

***Please note, I DID NOT capture in these screen clips the VERY *FIRST* pass of testing your latest script in CMD. Never considered it at the time because the thought was not on my mind. I should of now as an afterthought. I was more interested in the results than capturing on the FIRST pass. Visually on the VERY *FIRST* pass of testing your latest script in CMD, I recall the services were *DIFFERENT* in stoppages and just response in general than on the *SECOND* pass (different results) where I DID capture on the SECOND pass. To demonstrate very situation, I have another embedded attachment below, "Stop Or Shutdown An Active Internet Connection - Create BAT File in CMD Issue - Screen Clipping No. 13". This embedded attachment is actually the THIRD PASS of testing your latest script in CMD. Note the differences with services when comparing the SECOND pass to this THRID pass script in CMD. A matter-of-fact, EACH TIME this script is ran in CMD visually comparing service processes; there are different processes that are not stopping now that were stopped before… …and other services that are stopped now that were before were not stopped based on some dependency(s). Yes, there is ABSOLUTELY NO CONSISTENCY with Windows services on each pass or each time I run this script in CMD. To make the situation worse, the Windows services have dependencies that are indirectly impacted in some manner in the background. I clearly see this is purely out of your control and mine as well at this point. We both cannot 'standardize' the Windows services to make them consistent so to speak for each pass either since the services are in constant flux at the moment the script in ran in CMD. The good news is the that the bottom line:  That even with the different changes in processes results of the Windows services running the script in CMD each pass, they ALL now ARE ABLE to stop or shutdown an active internet connection successfully. Your script works!


With these random changes in services by running several passes with this script in CMD, I have lost track of what the system has set to default in terms of services at this point. The only means I figure to resolve these mixed and mismatched Windows services (services that are not running when they are supposed to be and vice versa from default settings) is take ALL the Windows services that you have implicated in ALL your scripts that are listed and set them back to default settings for my Windows 7 Professional 64-bit operating system, then system reboot/restart. Then rerun your latest script again in CMD and AT THAT *FIRST* INSTANCE, record all the services in process that are impacted while maintain original Windows services. This would help answer your question you post in your last comment, " I need to know what the current status of these services in 'Create BAT File in CMD Issue - Screen Clipping No. 2'. That way we dont start uneeded ones after you are ready to restore connectivity.... ".   I now figure is what I yet have to do in terms of resolve these mixed and mismatched Windows services.

I have a more attached and embedded SECOND passes attached below as two later more phases of running the script in CMD for your inspection too.

Once the internet connection is disconnected, running the remainder of 'operation' of the script and electing "N" or "No" (both without the quotes) in later phases of the script in CMD does not reverse or restore back to an active internet connection after disconnecting the internet connection the first phase of running this script in CMD the second pass. Obviously, after running this script in CMD does not restore active internet connection as a restoration phase of the script in CMD. Now, the only means I know to restore internet connection is to go to my system tray, click on network icon, and right-click on  "Troubleshoot problems", then run the "Windows Network Diagnostics". That is the only way I know how to restore and reconnect to the internet. It works successfully each time.  The only thing is as I stated before is that there still remains as I stated above, I will have mixed and mismatched Windows services -- they are out of sync.

So basically I see your script is still not completed in that there needs to be a restore active internet connection as a restoration phase of the script in CMD…

HOWEVER johnb6767, this is the ULTIMATE BOTTOM LINE with your script in CMD ***AND THIS IS WHAT I AM GOING TO DO***:

Any time running your script in CMD would ultimately mess up the Windows services from their 'expected' (lack for a better word) settings as if THEY ARE NOW OF OUT SYNC. An excellent analogy that comes to mind would be running an internal combustion engine involving modifying the engine timing. I do not know if you know much about engine timing of internal combustion engines, so I will keep it simple as I can. When adjusting the 'default' (lack of a better word and relate to computers) timing of the timing belt of an internal combustion engine; the cylinders of say a simple 4 stroke engine, the engine will still run, but not as efficiently from its default timing and you can get some possible random engine misfiring (analogy for Windows: I would say the congruent would be random error messages. Yes, I am now getting them and I am able to fix them as it stems from the Windows services being shut down. ). However I see the Windows services are more random patterns in nature and in a GREATER COMPLETE FLUX much more than a simpler cyclic internal combustion engine that will a little tinkering and resetting the timing belt back to the 'default' timing would run as new again. The same thing I need to do with Windows services. Basically, you cannot mess with Windows services since there must be complex dependencies happening in the background always placing the Windows services always in some random, very possibly some complex patterned flux that maybe Albert Einstein could figure out. Windows knows what it wants to do with its Windows services at any given moment in time.    

I am going to have to manually go into the Windows services and reset those impacted back to their default settings to make my Windows 7 'happy' again and forget this script you have provided me. I will actually go through ALL the Windows services to their defaults and reboot/restart the system. This is a time consuming process, short of reinstalling my Windows 7 Professional 64-bit. Windows upon system reboot, Windows 'should' pick up from the Windows services defaults and fix and adjust the services as it sees fit. I see the Windows services are in flux and CONSTANTLY changing as they need be left alone *ON THEIR OWN* in the background at any given one moment in time based on their prospective dependencies. This is totally grand NEW experience for me and I would think the same for you too. Yes, I am not going to yell at you like most other people I know would do at this point! THIS WAS A TRIAL!!! I understand the grand scheme of things and the circumstances and I see what is going on now. This was I learning experience for me and I hope for you too. But I know not to ever mess with Windows services -- leave them alone!

If johnb6767, if you have something to comment, which I am sure you will, please reply.

Yes, Thank you for trying!!!
 User generated image User generated image User generated image User generated image User generated image User generated image
@ thinkpads_user & johnb6767:

Hello again.

At this time I have decided to close this thread after carefully thinking it over. I am not going to 'push' (for lack of a better word) johnb6767 any more in this overly complex issue. Your latest script DOES WORK NOW! Obviously, I have to two solutions at this time since johnb6767 did ultimately end with a working script with much effort to try to resolve this question/thread by disconnecting the internet connection. Just as I elaborated on in my comment above, there are too many complex (that is an understatement) issues with this script interfering with the process of Windows services, plus add the dependencies factor, that cause system issues. If running the latest script in CMD produced 'consistent results' with Windows services each time the script ran things would be wonderful. Common sense says yes, it should be. However, as I said above, there are too many variables that are at work here to try to fix this issue to remain consistent on each run or pass. I think as someone has told me once, "You are chasing phantoms" which means no matter how hard you work to find the answer; it will continually and constantly allude you! That is what is happening here! johnb6767's dedication to get to this point in the complex issue deserves an very strong applause! Thank you ever, ever, ever so much to achieve the results that you did. !!! ;-)

Okay, who gets the ONLY ONE "Accepted Solution"? TO BE 'HONEST' and FAIR from the 'FASTEST' & 'EASIEST', BOTH are relatively quick. I would say after placing a shortcut on my desktop to execute the concept from thinkpads_user as indicated in thinkpads_user second comment, now thinkpads_user in all honesty and sincerity is the the 'FASTEST' & 'EASIEST' by a couple of mouse clicks, that is all after I tested both of these concepts. I was wondering at the beginning of this thread where johnb6767 was in essence going with johnb6767's concept and I had to find if the mechanics of this approach if it was indeed as 'FASTEST' & 'EASIEST' means to disconnect an internet connection. In truth, like thinkpads_user's concept, johnb6767's is relatively quick too. With the shortcut of thinkpads_user, I find it just a miniscule faster. Now, johnb6767's latest working script (johnb6767's last comment above), will get the "Assisted Solution" it DOES NOW work; but with issues.

In terms of points, normally I would award a greater share of the total points to the "Accepted Solution" over an "Assisted Solution". This time because of johnb6767's sheer constant dedication to such a complex issue to resolve it to make it workable script, I am going to split them in half or 250 points to each one of you for your working answers. I think that is fairest I can possibly achieve under the circumstances. Oh, thinkpads_user, I am breaking up your 250 points in half between your both responses for since BOTH comments COMBINED account for the 'fastest and easiest' method or concept. johnb6767, I am doing much the same with you too by splitting your points in half between your first comment announcing your own concept and the latest working script you have provided.  

Again, A BIG THANK YOU TO BOTH OF YOU for your answers and solutions to this issue!!! ;-)
Thank you (and also to JohnB for all his informative work). I was pleased to add my ideas as well.
.... Thinkpads_User
Thats why I said what I did in http:#36590872

I felt like a challenge, and I know how you like the fun stuff.....

What I didnt take into consideration though, is which services you have enabled, versus the ones that were stopped on the NSI service.Thats what put the kinks in the plans, and finally after stopping each one explicitly before the NSI, it worked. The trick now, would be to only target the ones (stopping and starting) that you have actually running... So as not to start uneeded ones...