Admin CMD Prompt - Clean & Reset Network

Page 3 of 4 FirstFirst 1234 LastLast

  1. Posts : 1,203
    11 Home
       #21

    Straightforward? Once you know how it all works, then yes, definitely that would completely be the case.

    Hopefully these will work.
    Reset Winsock
    Code:
    @echo off
    echo Please use Driver Store Explorer to remove all the network device drivers.
    start C:\tools\DriverStoreExplorer\Rapr.exe
    echo Press ANY key to Continue . . . & pause >nul
    cd /d "%UserProfile%\Desktop"
    netsh winsock show catalog >winsock-before.txt
    netsh winsock reset
    netsh winsock show catalog >winsock-after.txt
    start Notepad++.exe "%UserProfile%\Desktop\winsock-before.txt"
    start Notepad++.exe "%UserProfile%\Desktop\winsock-after.txt"
    echo **** THE SYSTEM WILL NOW BE RESTARTED. ****
    echo Press ANY key to Continue . . . & pause >nul & taskkill /IM Notepad++.exe /f >nul 2>&1
    shutdown /r
    In Driver Store Explorer, you can click on the Driver Class column header to sort by Driver Class, then scroll down to find the group of network adapters and click on the group title to select all drivers within that group. Next, you can press the spacebar to tick all the checkboxes for all the selected items with just a single keypress... makes life so much easier when trying to remove all device drivers for a given class (I sincerely hate to be the manager who uses Device Manager for this kind of task, lol).

    Reset TCP/IP settings
    Code:
    @echo off
    cd /d "%UserProfile%\Desktop"
    ipconfig /all >ip-settings-before-reset.txt
    netsh int ip reset >tcp_ip-reset-log.txt
    ipconfig /all >ip-settings-after-reset.txt
    start Notepad++.exe "%UserProfile%\Desktop\tcp_ip-reset-log.txt"
    start Notepad++.exe "%UserProfile%\Desktop\ip-settings-before-reset.txt"
    start Notepad++.exe "%UserProfile%\Desktop\ip-settings-after-reset.txt"
    echo Press ANY key to Continue . . . & pause >nul & taskkill /IM Notepad++.exe /f >nul 2>&1
      My Computers


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #22

    Thanks @hdmi,

    I noticed that you have used . . .

    Code:
    
    start C:\tools\DriverStoreExplorer\Rapr.exe

    . . . which obviously means that DriverStoreExplorer [ RAPR ] needs to be installed [ Open Source GitHub ]. @EdTittel, one of our long time members, favourable reviewed it on Win10.guru.

    I always try to use the Windows Built-In Tools unless there is NO other alternative.

    I could of course use Backup and Restore Device Drivers in Windows 10 prior to running netsh winsock reset by coding it into the Script.
    Last edited by Paul Black; 20 Jan 2022 at 14:35.
      My Computer


  3. Posts : 1,203
    11 Home
       #23

    Paul Black said:
    . . . which obviously means that DriverStoreExplorer [ RAPR ] needs to installed [ Open Source GitHub ]. @EdTittel, one of our long time members, favourable reviewed it on Win10.guru.
    It's portable so there is no way that you can install it, instead you just extract the downloaded zipfile to a folder (that would be C:\tools\DriverStoreExplorer in my case).

    As for always trying to use the Windows built-in tools. I vastly prefer to always try to use the right tool for the job. Deleting a whole set of drivers via Device Manager is just waa-aaaa-aaaaaaay too tedious. A lot of times, @EdTittel knows what's good. (Driver Store Explorer is definitely no exception to this.)
    GitHub - lostindark/DriverStoreExplorer: Driver Store Explorer [RAPR]
      My Computers


  4. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #24

    Thanks again @hdmi for your continued input,

    hdmi said:
    It's portable so there is no way that you can install it, instead you just extract the downloaded zipfile to a folder (that would be C:\tools\DriverStoreExplorer in my case).
    I realised that on further investigation.

    hdmi said:
    As for always trying to use the Windows built-in tools. I vastly prefer to always try to use the right tool for the job. Deleting a whole set of drivers via Device Manager is just waa-aaaa-aaaaaaay too tedious. A lot of times, @EdTittel knows what's good. (Driver Store Explorer is definitely no exception to this.)
    I agree. I downloaded it from DriverStore Explorer v0.11.72 - GitHub [ deleted the excess languages ] and I have had a quick look. It looks very good.

    On a regular basis, I extract the OEM Online 3rd Party Drivers using this which I created . . .

    Code:
    
    PowerShell "Get-WindowsDriver -Online | Select ClassDescription, ClassName, ClassGuid, ProviderName, BootCritical, DriverSignature, Driver, OriginalFileName, Date, Version | Sort-Object -Property ClassDescription, ProviderName, Date, Version | Format-Table -Autosize | Out-String -Width 1000" > %UserProfile%\Desktop\OEM_Drivers.txt
    
    

    . . . just for comparison.
      My Computer


  5. Posts : 1,203
    11 Home
       #25

    I modified your PoSH oneliner so it no longer displays the 0:00:00 part in the Date column.
    Code:
    PowerShell "Get-WindowsDriver -Online | Select ClassDescription, ClassName, ClassGuid, ProviderName, BootCritical, DriverSignature, Driver, OriginalFileName, @{Name='Date';Expression={ Get-Date -Date $_.Date -Format d }}, Version | Sort-Object -Property ClassDescription, ProviderName, Date, Version | Format-Table -Autosize | Out-String -Width 1000" > %UserProfile%\Desktop\OEM_Drivers.txt
      My Computers


  6. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #26

    hdmi said:
    I modified your PoSH oneliner so it no longer displays the 0:00:00 part in the Date column.
    Code:
    PowerShell "Get-WindowsDriver -Online | Select ClassDescription, ClassName, ClassGuid, ProviderName, BootCritical, DriverSignature, Driver, OriginalFileName, @{Name='Date';Expression={ Get-Date -Date $_.Date -Format d }}, Version | Sort-Object -Property ClassDescription, ProviderName, Date, Version | Format-Table -Autosize | Out-String -Width 1000" > %UserProfile%\Desktop\OEM_Drivers.txt
    Excellent, thanks for that @hdmi.
      My Computer


  7. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #27

    hdmi said:
    Straightforward? Once you know how it all works, then yes, definitely that would completely be the case.

    Hopefully these will work.
    Reset Winsock
    Code:
    @echo off
    echo Please use Driver Store Explorer to remove all the network device drivers.
    start C:\tools\DriverStoreExplorer\Rapr.exe
    echo Press ANY key to Continue . . . & pause >nul
    cd /d "%UserProfile%\Desktop"
    netsh winsock show catalog >winsock-before.txt
    netsh winsock reset
    netsh winsock show catalog >winsock-after.txt
    start Notepad++.exe "%UserProfile%\Desktop\winsock-before.txt"
    start Notepad++.exe "%UserProfile%\Desktop\winsock-after.txt"
    echo **** THE SYSTEM WILL NOW BE RESTARTED. ****
    echo Press ANY key to Continue . . . & pause >nul & taskkill /IM Notepad++.exe /f >nul 2>&1
    shutdown /r
    In Driver Store Explorer, you can click on the Driver Class column header to sort by Driver Class, then scroll down to find the group of network adapters and click on the group title to select all drivers within that group. Next, you can press the spacebar to tick all the checkboxes for all the selected items with just a single keypress... makes life so much easier when trying to remove all device drivers for a given class (I sincerely hate to be the manager who uses Device Manager for this kind of task, lol).

    Reset TCP/IP settings
    Code:
    @echo off
    cd /d "%UserProfile%\Desktop"
    ipconfig /all >ip-settings-before-reset.txt
    netsh int ip reset >tcp_ip-reset-log.txt
    ipconfig /all >ip-settings-after-reset.txt
    start Notepad++.exe "%UserProfile%\Desktop\tcp_ip-reset-log.txt"
    start Notepad++.exe "%UserProfile%\Desktop\ip-settings-before-reset.txt"
    start Notepad++.exe "%UserProfile%\Desktop\ip-settings-after-reset.txt"
    echo Press ANY key to Continue . . . & pause >nul & taskkill /IM Notepad++.exe /f >nul 2>&1
    Hi.

    Well, let's put this into context.

    What you have presented is just fine, but for me the short, original command sequence posted above works just fine.
    I know what to do manually, if something should go awry.

    You need to have Notepad++ installed as well - might want to place a Comment line on that.

    Thanks for the DriverStoreExplorer resource, it makes life easier.

    Last edited by Compumind; 20 Jan 2022 at 17:20.
      My Computer


  8. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #28

    Paul Black said:
    Ah, OK, thanks @Compumind.
    I see now that you wanted something a bit deeper.
    Didn't look like that at first glance.

    Be well.

      My Computer


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #29

    Thanks for the continued input @Compumind, it is appreciated.

    Compumind said:
    I see now that you wanted something a bit deeper.
    Didn't look like that at first glance.
    Initially, the request was for a basic method of resetting the Network, and thanks to you BOTH, the original Command sequence posted [ minus netsh winsock reset ] was confirmed to be the correct Command sequence to achieve this.

    I then posted that I wanted to change the focus to include a more in depth method, which is why this thread has evolved into a more thorough and detailed topic.
    Last edited by Paul Black; 20 Jan 2022 at 18:18.
      My Computer


  10. Posts : 1,203
    11 Home
       #30

    Compumind said:
    Hi.

    Well, let's put this into context.

    What you have presented is just fine, but for me the short, original command sequence posted above works just fine.
    I know what to do manually, if something should go awry.

    You need to have Notepad++ installed as well - might want to place a Comment line on that.

    Thanks for the DriverStoreExplorer resource, it makes life easier.

    Yeah, these three scripts are intended for those people who, like @Paul Black, have Notepad++ installed with the comparison plugin and who might want to use that to view/compare more data (in order to be able to troubleshoot troubles in the possible event that troubles have manifested theirself ) during 1/ a basic, or low-level reset and/or (optional) 2/ a separate, Winsock reset (followed by a reboot) that can be performed after all the device drivers for the network adapter(s) have─per your original suggestion─been deleted (by using Driver Store Explorer instead of using Device Manager) and/or 3/ a (also separate) TCP/IP settings reset.

    I get your point that the commands are easy enough to type in manually. But it sure is a lot of typework, and so you never know when you might bump into a situation when time is of the essence and then you just wish that you had scripts (and Notepad++ with the comparison plugin and and and...). Me, I never have network problems. It's like my dad always says. If you never do anything. Then you can never do anything wrong!
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:30.
Find Us




Windows 10 Forums