Wednesday, September 3, 2014

USB ကို Bat file နဲ႕ bootable လုပ္မယ္(Window 7ေပၚတြင္စမ္းထားပါသည္)


အရင္ဆံုး ဒီေလးေရးဖို႕ဟိုတေလာကေျဖေပးတဲ့ဆရာဆရာမမ်ားအားလံုးကိုေက်းဇူးပါလို႕ :)
USB ကို bootable ျဖစ္ေအာင္လုပ္တယ္ဆိုတာက USB နဲ႕ window တင္ဖုိ႕ေပါ့ေနာ္ :P
ဥပမာ CD DVD Drive ေတြျပက္သြားရင္USB ကို Bootable ျဖစ္ေအာင္လုပ္ပီး အဲ့ usb ကိုျပန္သံုးပီးwindow တင္လို႕ရပါတယ္
အဲ့တာတားတိတာပါ တိခ်င္ရင္ tag ထားတဲ့ဆရာ ဆရာမေတကိုေမးပါ :P


အရင္ဆံုး windown key +R နိပ္ပီး run box ေခၚပါ
notepad လို႕၇ိုက္ပီးအန္းတားေခါက္ပါက္ဆံုးကcode ေတြအကုန္ေကာ္ပီကူးပီး notepad ထဲထည့္ပါ
ctrl+S နိပ္ပါ file name မွာ bootable.bat လို႕ေပးပါ desktop ေပၚမွာ ေရြးပီး save ေပးပါ

desktop ေပၚမွာ bootable.bat ေလးေရာက္ေနရင္ double click လိုက္ပါ administrator mode နဲ႕ run ဖို႕ေျပာပါလိမ့္မယ္
အန္းတားတစ္ခ်က္ေခါက္လိုက္ပါပိတ္သြားပါလိမ့္မယ္
bootable.bat မွာ right click ေထာက္ပီး run as administrator ကိုကလစ္ေပးပါ ဒါဆိုက်လာပါပီ
USB stick ထိုးထားပါ (ကြန္ပ်ဴတာတြင္USB တစ္ေခ်ာင္းထဲသာထိုးထားပါ)
Window ေခြထည့္ထားပါ
create  လို႔ရိုက္ပီးအန္းတားေခါက္ပါဒါဆို list က်လာမယ္
usb device storage ကုိျကည့္ပိးအဲ့မွာခြဲပါ((((((( ပံုမွန္ က ကြန္ပ်ဴတာထဲက harddisk က ၀ ပါ
usb က 1ပါ))
ကၽြန္ေတာ့ ခုလုပ္ေနတာက usb 8gb ပါ size က7580mbလို႔cmd မွာေရးထားတပါတယ္ size ကိုျကည့္ပီးdisk ၀ လား 1 လားခဲြပါ
ကၽြႏ္ေတာ့္မွာ က 1 ပါ

1 လို႔ရိုက္ပီးအန္းတားေခါက္လိုက္ပါ
ဒါဆိုရင္သူ stick ကို format ခ်ေပးပါလိမ့္မယ္
ပီးရင္ေနာက္တစ္ပိုင္းကူးသြားပါလိ္မ့္မယ္
ဒီအပိုင္းက CD drive ထဲက Window data ေတြကို ခု format ခ်ထားတဲ့ Stick ထဲထည့္ဖို့ပါ

 CD drive ရဲ႕ Drive name ေတာင္းပါလိမ့္မယ္
my computer ကိုသြားပီး CD drive ကိုျကည့္ပါ(((ကၽြႏ္ေတာ့္မွာ E ပါ))ရိုက္
ပီးရင္အန္းတားေခါက္ပါ
ပီးရင္ stick ရဲ႕ Drive ကိုေတာင္းပါလိမ့္မယ္
my computer မွာ ပဲသြားျကည့္ပါ :P((ကၽြန္ေတာ့္မွာက F ပါ) F လို႕ေရးပီးအန္းတားေခါက္လိုက္ပါ
 ပီးတာနဲ႕ CD Drive ထဲက ေန USB ထဲကို window data ေတြကူးေနပါလိမ့္မယ္((ျကာမယ္ေနာ့))
ပိးသြားရင္ပီးသြားပါပီ
ခု usb ေလးကို window ေခြလိုသံုးပီး window တင္လို႕ရပါပီ
နားမလည္တဲ့နားျပန္ေမးပါခင္ဗ်
အဆင္ေျပပါေစ

စိတ္ေတာ့ဆိုးနဲ႕ ဒီပိုစ္ထဲက bat file ကိုကူး၇င္ေသခ်ာေလးျပန္ရွင္းျပေပးပါလို႕ :)
အဆင္ေျပပါေစ
ရပ္ေစာက္သား(IT Learner And Sharer)

code
@echo off
md %windir%\myothantkyaw>NUL
if %errorlevel%==0 (
rd %windir%\myothantkyaw
goto :error
) else (
echo Right click the file and run as administrator
echo.
pause
exit
)

:error
if not exist C:\yatsauktarlay1.txt (
goto :mtk
) else (
goto :Delete



)

:Main
cls
color 0a
echo.      ################################
echo.      ##                            ##
echo.      ##   USB Bootable Program     ##
echo.      ##                            ##
echo.      ################################   
echo.
echo     This Program use to create Windows with usb Device .

echo        Good Luck All Of My Aunt and Aunty hak hak :D


echo.
echo.
echo            **.Type "create" To Create Bootable USB Device.


echo.
echo            **.Type "Exit" To exit This Program.
echo.
echo.
echo.
echo                        ********************************
echo                        *Created By:(yatsauktarlay1996)*
echo                        ********************************
echo.
echo.

set /p yst=Type you want:

if %yst%==create goto :create
if %yst%==exit exit
msg * Type Valid!!!!!
goto :Main



:create
diskpart /s C:\myothantkyaw.txt
echo.
echo.
set /p myo=Check your Usb Device and type Disk no and press enter:
echo.
echo.
if %myo%==1 goto :1
if %myo%==2 goto :2
if %myo%==3 goto :3
if %myo%==4 goto :4
msg * Type Valid Disk No!!!!!
cls
goto :create

:1
diskpart /s C:\yatsauktarlay1.txt
goto :DVD




:2
diskpart /s C:\yatsauktarlay2.txt
goto :DVD





:3
diskpart /s C:\yatsauktarlay3.txt
goto :DVD


:4
diskpart /s C:\yatsauktarlay4.txt
goto :DVD














:mtk






echo SELECT DISK 1 >>C:\yatsauktarlay1.txt
echo CLEAN  >>C:\yatsauktarlay1.txt
echo CREATE PARTITION PRIMARY  >>C:\yatsauktarlay1.txt
echo SELECT PARTITION 1 >>C:\yatsauktarlay1.txt
echo ACTIVE  >>C:\yatsauktarlay1.txt
echo FORMAT QUICK  >>C:\yatsauktarlay1.txt
echo EXIT >>C:\yatsauktarlay1.txt

echo SELECT DISK 2 >>C:\yatsauktarlay2.txt
echo CLEAN  >>C:\yatsauktarlay2.txt
echo CREATE PARTITION PRIMARY  >>C:\yatsauktarlay2.txt
echo SELECT PARTITION 2 >>C:\yatsauktarlay2.txt
echo ACTIVE  >>C:\yatsauktarlay2.txt
echo FORMAT QUICK  >>C:\yatsauktarlay2.txt
echo EXIT >>C:\yatsauktarlay2.txt


echo SELECT DISK 3 >>C:\yatsauktarlay3.txt
echo CLEAN  >>C:\yatsauktarlay3.txt
echo CREATE PARTITION PRIMARY  >>C:\yatsauktarlay3.txt
echo SELECT PARTITION 3 >>C:\yatsauktarlay3.txt
echo ACTIVE  >>C:\yatsauktarlay3.txt
echo FORMAT QUICK  >>C:\yatsauktarlay3.txt
echo EXIT >>C:\yatsauktarlay3.txt

echo SELECT DISK 4 >>C:\yatsauktarlay4.txt
echo CLEAN  >>C:\yatsauktarlay4.txt
echo CREATE PARTITION PRIMARY  >>C:\yatsauktarlay4.txt
echo SELECT PARTITION 4 >>C:\yatsauktarlay4.txt
echo ACTIVE  >>C:\yatsauktarlay4.txt
echo FORMAT QUICK  >>C:\yatsauktarlay4.txt
echo EXIT >>C:\yatsauktarlay4.txt

echo list disk>>C:\myothantkyaw.txt
goto :Main

:Delete
del /f /q C:\myothantkyaw.txt
del /f /q C:\yatsauktarlay1.txt
del /f /q C:\yatsauktarlay2.txt
del /f /q C:\yatsauktarlay3.txt
del /f /q C:\yatsauktarlay4.txt
goto :Mtk



:DVD
cls
color 0d
echo            Copy DVD Drive Data to USB Bootable Disk
echo            ***********************************************
echo.
echo.
set /p mtk=Please Type your DVD(or)CD Drive Latter and press enter:
echo.
echo.
::set /p yst=Please type your Bootable USB Stick Latter and press enter:
xcopy /e /f /s %mtk%:\*.* %yst%:
start http://yatsauktarlay1996.blogspot.com/
gogo :graphic





:graphic
:top
cls
echo.
echo.
echo.
echo.              #######################################
echo.             ##                                   ##
echo.              ##   Complete Bootable Program Bye.  ##
echo.              ##                                   ##
echo.              #######################################
echo.
echo.
echo.
echo.
echo                        ********************************
echo                        *Created By:(yatsauktarlay1996)*
echo                        ********************************
color 1a
ping localhost -n 0 >nul
color 2b
ping localhost -n 1 >nul
color 3c
ping localhost -n 0 >nul
color 4d
ping localhost -n 1 >nul
color 5e
ping localhost -n 1 >nul
color 6f
ping localhost -n 2 >nul
color 7a
ping localhost -n 0 >nul
color 8b
ping localhost -n 0 >nul
color 9c
ping localhost -n 2 >nul
goto :up

:up
cls
echo.
echo.
echo.
echo.              #######################################
echo.             ##                                   ##
echo.              ##   Complete Bootable Program Bye.  ##
echo.              ##                                   ##
echo.              #######################################
echo.
echo.
echo.
echo.
echo.
echo                        ********************************
echo                        *Created By:(yatsauktarlay1996)*
echo                        ********************************
color 1a
ping localhost -n 0 >nul
color 2b
ping localhost -n 0 >nul
color 3c
ping localhost -n 0 >nul
color 4d
ping localhost -n 0 >nul
color 5e
ping localhost -n 0 >nul
color 6f
ping localhost -n 0 >nul
color 7a
ping localhost -n 0 >nul
color 8b
ping localhost -n 0 >nul
color 9c
ping localhost -n 0 >nul
goto :top

0 comments:

Post a Comment