IT Scripts Entry
For privacy, our company name in the script has been changed to "CompanyX"

Script Name: CompanyX Network Adapter Reset Tool


Language: Batch Script for Command Line (Windows)


Purpose: In the event of wireless issues or connectivity problems, I pre-install this script on company laptops in the field so that they can automatically release/renew their IP address, clear ARP tables, test pinging, etc.


Notes: I've converted this Batch (.BAT) script to .EXE so it can be given an icon and is less confusing for our employees.


Script:



@echo off

echo.

title CompanyX Network Adapter Reset Tool

:prompt

color 0C

cls

echo ============================================

echo COMPANYX NETWORK ADAPTER RESET TOOL

echo ============================================

echo Version 1.79

echo ============================

echo.

echo NOTE: The reset command will not work on machines with a static IP.

echo QUESTIONS: Please email support@companyx.com

echo.

echo.

echo ----------

echo MAIN MENU:

echo ----------

echo.

echo Type 'r' to reset network settings, IP log; flush DNS cache and ARP tables

echo Type 'v' to view network adapter settings

echo Type 'pe' to do a ping test of external resources

echo Type 'pi' to do a ping test of internal resources

echo Type 'pia' to do an exhaustive ping test of almost all internal resources

echo Type 'c' to open a command prompt

echo Type 'q' to exit this program

set /p answer=

if ‘%answer%’ == ‘r’ goto reset

if ‘%answer%’ == ‘R’ goto reset

if ‘%answer%’ == ‘v’ goto view

if ‘%answer%’ == ‘V’ goto view

if ‘%answer%’ == ‘Pe’ goto pinge

if ‘%answer%’ == ‘pe’ goto pinge

if ‘%answer%’ == ‘Pi’ goto pingi

if ‘%answer%’ == ‘pi’ goto pingi

if ‘%answer%’ == ‘Pia’ goto pingia

if ‘%answer%’ == ‘pia’ goto pingia

if ‘%answer%’ == ‘C’ goto cmd

if ‘%answer%’ == ‘c’ goto cmd

if ‘%answer%’ == ‘q’ goto quit

if ‘%answer%’ == ‘Q’ goto quit

std::string foo;

:reset

cls

echo RELEASING CURRENT IP ADDRESS... PLEASE WAIT...

ipconfig /release >nul

echo.

echo Current IP Address has been released successfully!

echo.

echo RESETTING IP LOG... PLEASE WAIT...

@netsh int ip reset C:WindowsTEMPIPRESETLOG.txt >nul

echo.

echo IP Log has been reset successfully!

echo.

echo FLUSHING ARP TABLES... PLEASE WAIT...

@netsh interface ip delete arpcache >nul

echo.

echo Address Resolution Protocol Tables have been flushed successfully!

echo.

echo FLUSHING DNS... PLEASE WAIT...

@ipconfig /flushdns >nul

echo.

echo DNS client resolver cache has been flushed successfully!

echo.

echo RENEWING IP... PLEASE WAIT...

@ipconfig /renew >nul

echo.

echo IP Address has been renewed successfully!

echo.

cls

echo POLLING CURRENT STATUS OF IP CONNECTIONS ON THIS COMPUTER... PLEASE WAIT...

ipconfig /all

echo.

echo Reset network settings has completed successfully with no errors.

echo.

echo Please press any key to return to the main menu...

pause >nul

goto prompt

:view

cls

echo PREPARING TO DISPLAY NETWORK ADAPTER SETTINGS... PLEASE WAIT...

echo.

@ipconfig /all

echo.

echo Please press any key to return to the main menu...

pause >nul

goto prompt

:pinge

cls

echo STARTING PING TEST OF EXTERNAL WEBSITES... PLEASE WAIT...

echo.

ping www.google.com

echo.

echo Please press any key to return to the main menu...

pause >nul

goto prompt

:pingi

cls

echo STARTING PING TEST OF INTERNAL RESOURCES... PLEASE WAIT...

echo.

ping internal.companyx.com

echo.

echo Please press any key to return to the main menu...

pause >nul

goto prompt

:pingia

cls

echo STARTING EXHAUSTIVE PING TEST OF INTERNAL RESOURCES... PLEASE WAIT...

echo.

echo If you receive a cascade of errors, you are not connected to the COMPANYX VPN.

echo.

ping internal1.companyx.com

echo.

ping internal2.companyx.com

echo.

ping internal3.companyx.com

echo.

ping internal4.companyx.com

echo.

ping internal5.companyx.com

echo.

ping internal6.companyx.com

echo.

ping internal7.companyx.com

echo.

ping internal8.companyx.com

echo.

ping internal9.companyx.com

echo.

ping internal10.companyx.com

echo.

echo Please press any key to return to the main menu...

pause >nul

goto prompt

:quit

cls

echo.

echo Thank you for using the CompanyX Network Adapter Reset Tool!

echo.

echo.

pause

exit

:cmd

@color 7

cls

cmd

@echo on



Software/Hardware used:
Batch script for Windows (including 7) converted to an EXE
ASKED: Oct 11, 2011  10:48 PM GMT
UPDATED: April 12, 2012  8:31:08 AM GMT
  Help
 Approved Answer - Chosen by MakeITfunctional (Question Asker)

[...] Creative: Community newcomer MakeITFunctional made a splash with CompanyX Network Adapter Reset Tool, which we loved since it helped solve a very common problem (we were helping someone tackle the [...]
ANSWERED:  Oct 20, 2011  6:41 AM (GMT)  by Announcing the winners of the IT Scripts Contest - ITKE Community Blog   0 pts.

 
Other Answers:
Restores the Windows Firewall with Advanced Security policy to the default policy. The current active policy can be optionally exported to a specified file. In a Group Policy object, this command returns all settings to not configured and deletes all connection security and firewall rules... VPN Reviews thanks
Last Wiki Answer Submitted:  Jan 22, 2012  11:34 AM (GMT)  by  Zagam2   35 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _




[...] Creative: Community newcomer MakeITFunctional made a splash with CompanyX Network Adapter Reset Tool, which we loved since it helped solve a very common problem (we were helping someone tackle the [...]


 

Seems interesting and very Helpful Thank you !!

Cold Aisle Containment | Hot Aisle Containment

 15 pts.