Disconnecting Internet connection

Posted on 2009-12-16
Last Modified: 2014-07-09
Hello Experts,

I have a wireless connection at home (OS - Vista Home Basic). Every time I shut down my machine, I have to disconnect it (just as a good practice). Can somebody help me in writing a script that will disconnect the connection (if it is still connected) before shutdown?? How to insert that script in shutdown path???

Question by:milindsm
    LVL 3

    Accepted Solution

    Here you go for the solution :

    Just add the command to the shutdown script after you have identified your device hardware id.
    Shutdown script in Group Policy gpedit.msc > computer configurations > windows settings > scripts
    LVL 18

    Expert Comment

    Excuse me, but, after a operating system shutdown...what is there to disconect ?
    LVL 8

    Author Comment

    Just a good practice. There is possibility that session remains open at ISP side. I have faced this issue in the past. I'd to then call up ISP support and had to ask them to terminate all active sessions.
    LVL 18

    Expert Comment

    On the client side, if you right click the wireless addapter and chose disconnect, the session does not hang at the ISP?
    LVL 8

    Author Comment

    Not sure about this. But I have face such problem before. I forgot to disconnect before shutting down the OS. Next time when I logged in within say 20-30 minutes, I could not log on to network. I called up ISP support n that fellow told me that there are previous active sessions that need to be closed. He did that from his side n it worked. Not sure if it is ISPs problem..!!!
    LVL 8

    Assisted Solution


    This script assumes it's a wireless connection you want to disconnect.

    Copy and Paste the code into notepad.

    To find your Wireless_Connection_Name type ncpa.cpl into the vista search box.

    Write down the name of your connection exactly then replace Wireless_Connection_Name in the script with your wireless connection name.

    Save the code as a batch file by saving the file as Shutdown.bat

    Double click Shutdown.bat to disconnect and shutdown.

    ::Disconnect and Shutdown the system
    netsh wlan disconnect interface="Wireless_Connection_Name"
    shutdown /s /p /f

    Open in new window

    LVL 67

    Expert Comment

    I've requested that this question be deleted for the following reason:

    Not enough information to confirm an answer.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article will show, step by step, how to integrate R code into a R Sweave document
    In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now