Friday, October 17, 2014

Network ကို Bat File ေလးနဲ႕ Release & Renew လုပ္မယ္



Network ကို Bat File ေလးနဲ႕ Release & Renew လုပ္မယ္

ဒီနည္းလမ္းေလးကေတာ့ ပံုမွန္အားျဖင့္လည္း ရိုးရွင္းပါတယ္။
Systematically အရကေတာ့ Network and Sharing ကေန
တဆင့္ သြားလို႕ရသလို Command Prompt ထဲကေနလည္း
"ipconfig /release" "ipconfig /renew" ဆိုၿပီးလုပ္ေဆာင္
ရတာပါ။ ဒါေပမယ့္ ကၽြန္ေတာ္အခုေပးမယ့္ Script ေလးကေတာ့
IP ကို Release ၊ Renew အျပင္ DNS ကို ပါ လွမ္း Ping တဲ့
Script ေလးျဖစ္ပါတယ္။ Batch File ေလးျဖစ္တာေၾကာင့္သံုး
ရတာလြယ္ကူၿပီး မိမိစိတ္ႀကိဳက္ EXE ဖိုင္အျဖစ္လည္း ေျပာင္း
လည္းသံုးစြဲႏိုင္ပါတယ္။ Bat to EXE ေျပာင္းဖို႕ Software ကို
ေတာ့္ ဒီ Post မတိုင္ခင္ ေဒါင္းရမယ့္ လင့္ခ္ေပးထားပါတယ္။
ယခု Icon ေတြေဒါင္းဖို႕လင့္ခ္ေလးေပးပါ့မယ္။
http://www.iconarchive.com/tag/network မွာေဒါင္းပါ။
ေရးရမယ့္ Script ကေတာ့
@echo off
title NETWORK RESET SCRIPT
:prompt
color 1f
cls
echo NETWORK RESET SCRIPT
echo.
echo Type r to Reset Network
echo Type p to do a ping test
echo Type c to go to Command Prompt
echo Type q to exit
set /p answer=
if ‘%answer%’ == ‘r’ goto test
if ‘%answer%’ == ‘R’ goto test
if ‘%answer%’ == ‘C’ goto cmd
if ‘%answer%’ == ‘c’ goto cmd
if ‘%answer%’ == ‘q’ goto quit
if ‘%answer%’ == ‘Q’ goto quit
if ‘%answer%’ == ‘P’ goto ping
if ‘%answer%’ == ‘p’ goto ping
pause >nul

:test
cls
echo —————————————————-
echo – RELEASING IP…. -
echo —————————————————-
ipconfig /release >nul
echo.
echo Done!
echo.
echo —————————————————-
echo – RESETTING IP LOG… -
echo —————————————————-
@netsh int ip reset C:WindowsTEMPIPRESETLOG.txt >nul
echo.
echo Done!
echo.
echo —————————————————-
echo – FLUSHING ARP TABLES… -
echo —————————————————-
@arp -d >nul
echo.
echo Done!
echo.
echo —————————————————-
echo – FLUSHING DNS… -
echo —————————————————-
@ipconfig /flushdns >nul
echo.
echo Done!
echo.
echo —————————————————-
echo – RENEWING IP… -
echo —————————————————-
@ipconfig /renew >nul
echo.
echo Done!
echo.
cls
echo —————————————————-
echo Heres Your Status: -
echo —————————————————-
ipconfig /all
echo.
echo Press Any Key to Go To Menu
pause >nul
goto prompt

:ping
cls
echo —————————————————-
echo Starting Ping Test… -
echo —————————————————-
echo.
ping google.com
echo.
echo Press Any Key to goto MENU
pause >nul
goto prompt

:quit
cls
echo Thanks For Using The Network Reset Script
pause
exit

:cmd
@color 7
cls
cmd
@echo on
ဆိုၿပီးျဖစ္ပါတယ္။ ၿပီးသြားရင္ေတာ့ Batch File Format ျဖင့္
သိမ္းဆည္းၿပီး အလြယ္တကူလုပ္ေဆာင္ႏိုင္မွာျဖစ္ပါတယ္။
ေလးစားစြာျဖင့္
Cristiano Zarni@ဦးဇာနည္

No comments:

Post a Comment