CCTV TECH
Nassau, Bahamas
Search this site Search Help
Default
Newest
Oldest
Your Ad here
 
 
 
Make USB Disk Bootable

UPDATED March 29th, 2011:
added the HP USB DOS format tool


This creates a MS-DOS Bootable USB Drive from the users XP source files.

** THIS IS FOR INFORMATION ONLY - USE AT YOUR OWN RISK **

The default setting uses the Windows XP System32 folder. Optionally the user can change the option within the file to use an XP setup source. As a result no MS-DOS boot files have to be distributed with this as they are extracted from a boot disk included with XP, which is actually a modified Windows Me DOS Boot disk.

You will require ADMIN privileges on your Windows computer.

This uses the HP USB Dos format tool and is copyright HP.
That tool is no longer available on the HP site so it is included in this download.
You must accept the HP End User License which is also included.

The process is as follows:


Create temp folder in working folder
Extract Boot files from diskcopy.dll into a temp folder
Extract/Copy Format.com into a temp folder
Run Format.com and dismount USB drive
Run HP Format tool and make USB drive bootable
Remove temp folder

READ ME
------------------

Download the attached package.
Right click over mkboot.cmd and click edit.
Change USBDRV value R: to the letter of your USB Drive.
Exit and Save then click on Batch File.

** MAKE SURE THE USB DRIVE LETTER IS CORRECT **

Download the ready made package:
Download ZIP


INCLUDED FILES
------------------------

DCFR.COM
XPBTDSK.EXE
HPUSBF.EXE

BATCH FILE
------------------

Make new Text file and rename it something.cmd (whatever you want to name it, eg. mkboot.cmd)
Right click EDIT then place the following into it, change the USB Drive letter, and save.

Optional:
Place custom DOS files and folders in a sub folder called ADDDOS and they will be copied to the USB Drive.

mkboot.cmd
@echo off

:: MAKE USB DISK MS DOS BOOTABLE 
:: USES XP SYSTEM32 FOLDER OR XP SETUP SOURCE
:: CHANGE USER SETTINGS BELOW

:_setting

   SET USBDRV=R:
   SET XPSRC=C:\i386
   SET USESRC=NO

:_load

   CLS
   ECHO ALL FILES WILL BE DELETED ON USB DRIVE %USBDRV%
   ECHO CLICK THE [X] AT THE TOP RIGHT TO EXIT NOW OR ...
   PAUSE
   CLS

:_chkusb

   :: CHECK USB DRIVE
   ECHO checking USB Drive %USBDRV% ..

   IF NOT EXIST %USBDRV%\CON GOTO _ERR
   IF %USBDRV%==C: GOTO _ERR
   IF %USBDRV%==c: GOTO _ERR

:_chksrc1

   :: CHECK XP SOURCE
   ECHO checking XP source ..
   IF %USESRC%==YES GOTO _chksrc2

   IF NOT EXIST %windir%\system32\diskcopy.dll GOTO _ERR
   IF NOT EXIST %windir%\system32\expand.exe GOTO _ERR
   GOTO _chksys

:_chksrc2

   IF NOT EXIST %XPSRC%\diskcopy.dl_ GOTO _ERR
   IF NOT EXIST %XPSRC%\expand.exe GOTO _ERR

:_chksys

   :: CHECK REQUIRED FILES
   ECHO checking required files ..

   IF NOT EXIST SYSTEM\XPBTDSK.EXE GOTO _ERR
   IF NOT EXIST SYSTEM\DCFR.COM GOTO _ERR
   IF NOT EXIST SYSTEM\HPUSBF.EXE GOTO _ERR
   IF NOT EXIST tmp\CON MD tmp
   DEL /Q tmp\*.*
   IF NOT EXIST tmp\CON GOTO _ERR

:_mkfiles1

   ECHO start create boot files ..
   IF %USESRC%==YES GOTO _mkfiles2
   COPY /y %windir%\system32\diskcopy.dll tmp\diskcopy.dll
   GOTO _mkfiles3

:_mkfiles2

   %XPSRC%\EXPAND %XPSRC%\diskcopy.dl_ -F:diskcopy.dll tmp\diskcopy.dll

:_mkfiles3

   ECHO extracting bootdisk ..

   SYSTEM\XPBTDSK.EXE tmp\diskcopy.dll tmp\bootdisk.tmp
   IF NOT EXIST tmp\bootdisk.tmp GOTO _ERR

   ECHO extracting files from bootdisk ..
   SYSTEM\DCFR.COM -e tmp\bootdisk.tmp COMMAND.COM IO.SYS MSDOS.SYS tmp

   IF EXIST tmp\diskcopy.dll DEL tmp\diskcopy.dll
   IF EXIST tmp\bootdisk.tmp DEL tmp\bootdisk.tmp

:_chkboot

   :: CHECK BOOT FILES CREATED
   IF NOT EXIST TMP\COMMAND.COM GOTO _ERR
   IF NOT EXIST TMP\IO.SYS GOTO _ERR
   IF NOT EXIST TMP\MSDOS.SYS GOTO _ERR
   ECHO boot files extracted okay

:_chkformat1

   :: CHECK FORMAT EXISTS IN SYSTEM FOLDER
   ECHO checking format.com ..
   IF %USESRC%==YES GOTO _chkformat2

   IF NOT EXIST %windir%\system32\format.com ECHO format.com does not exist
   IF NOT EXIST %windir%\system32\format.com GOTO _hpformat

   COPY /y %windir%\system32\format.com tmp\format.com
   IF NOT EXIST tmp\format.com GOTO _hpformat

   ECHO format.com copied okay
   GOTO _xpformat

:_chkformat2

   :: TRY EXPAND FROM XP SOURCE   
   IF EXIST %XPSRC%\format.co_ %XPSRC%\EXPAND %XPSRC%\format.co_ -F:format.com tmp\format.com

   IF NOT EXIST tmp\format.com ECHO format.com not extracted
   IF NOT EXIST tmp\format.com GOTO _hpformat

   ECHO format.com extracted okay

:_xpformat

   ECHO formatting with xp format.com ..
   tmp\format.com %USBDRV% /FS:FAT32 /q /u /backup /v:ETOOLS /x

:_hpformat

   ECHO formatting with HP USB format ..
   SYSTEM\HPUSBF %USBDRV% -FS:FAT32 -V:ETOOLS -B:TMP -Y

:_copydos

   IF NOT EXIST %windir%\system32\xcopy.exe GOTO _EXIT
   IF EXIST ADDDOS\CON ECHO copying custom DOS files ..
   IF EXIST ADDDOS\CON %windir%\system32\xcopy.exe ADDDOS\*.* %USBDRV%\ /i /k /e /r /y /h
   GOTO _EXIT

:_ERR

   IF EXIST TMP\CON RD /S /Q TMP
   ECHO ERROR!!
   PAUSE
   EXIT

:_EXIT
   IF EXIST TMP\CON RD /S /Q TMP
   ECHO.
   ECHO Completed Okay
   PAUSE
  EXIT

CCTV | DVR | Video Surveillance | Day Night | CCTV Cameras | Remote Video | Tech Support | Software | Scripts | Visual Basic | Articles | Yellow Pages | Real Estate
Copyright © 2001/2012 BahamasSecurity.com
 
Website hosted in Nassau, The Bahamas