Greeting all
Has anyone tried and been successful in formatting and re-purposing HDD for DOS based computers..If yes , how , please provide details .
Thanks much....
Greeting all
Has anyone tried and been successful in formatting and re-purposing HDD for DOS based computers..If yes , how , please provide details .
Thanks much....
As mentioned they are usually standard HDD's and can be formatted on a PC for use in a PC or Mac. Also as mentioned depending on the age of the copier they tend to be on the smaller side. I have acquired a couple terabyte HDD's that would not work in a copier but are fine in a computer. Even a 320Gb or 500Gb drive is not bad to use for backup for files on a computer.
Here's a batch file to Wipe clean any old working HDD.
This does a factory reset of the HDD back to an UNINITIALISED drive.
I wrote this in a hurry this morning, I haven't fully tested it on an old HDD.
Some one may like to test the below batch file on an old drive.
Cut and paste the below to a text file named "CleanHDD.bat"
-----------------------------------8<------ -----------------------------------------
echo off
rem Hard Disk Drive Clean. Reset HDD to Factory Uninitialized.
Rem Useage: CleanHDD /Secure = factory clean.
rem Author NeoMatrix, www.copytechnet.com
rem Date:5-12-18 Ver1.0
setlocal ENABLEDELAYEDEXPANSION
Set "ErrorFlag="
set "Star="
for /L %%S in (1,1,49) do set Star=!Star!*
set "Line="
for /L %%S in (1,1,80) do set Line=!Line!-
set "Param="
if /i "%1"=="/Secure" set Param="All"
rem -------- Main flow ------
:Main
cls
Call :Header
Call :HDD_Info
Call :SelectDisk DiskNo
Call :Prompt Action
Call :WipeHDD %Action% DiskNo Error
Call :Footer %Error%
goto End
rem ---------- Header -----------
:Header
echo **************** Hard Drive Clean ****************
echo **** WARNING ALL HDD DATA CANNOT BE RECOVERED ***
echo Usage: CleanHDD.bat [switch]
echo Example : CleanHDD
echo CleanHDD /Secure
echo *** CleanHDD must be Run as administrator only.***
echo %Star%
exit /B
rem ---------- HDD Information -----------
:HDD_Info
(echo rescan
echo list disk
echo list vol) | diskpart
wmic diskdrive list brief
echo %Line%
exit /b
rem ---------- Select disk -----------
:SelectDisk DiskNo
set /p DiskNo="Select Disk, Enter number >"
set %1=%DiskNo%
rem (echo select disk %DiskNo%) | diskpart
echo.
Exit /B
rem ---------- Prompt -----------
:Prompt Action DiskNo VolumeNo
choice /C YNC /M "Totally Wipe Clean Disk:%DiskNo%"
if %ERRORLEVEL%==1 set Action=Prompt
if "%Action%"=="Prompt" (
choice /C YNC /M "HDD clean CANNOT be recovered, continue..."
if %ERRORLEVEL%==1 set %1=Wipe
)
Exit /B
rem ---------- Wipe HDD -----------
:WipeHDD Action %DiskNO% Error
if NOT "%1"=="Wipe" exit /B
if /i %Param%=="All" (
echo HDD Secure cleaning mode will take some time...
echo.
)
rem -- CRITICAL SECTION --
(echo sel disk %DiskNo%
echo clean %Param% ) | diskpart
rem diskpart fails to set errorlevels.
set %3=%Errorlevel%
exit /B
rem ---------- Footer -----------
:Footer Action
echo Finished cleaning....
echo %Line%
echo HDD is now Wiped Clean.
echo All HDD Partitions and Formatting removed.
echo HHD is factory default UNINITIALIZED configuration.
echo.
exit /B
rem ---------- Exit-----------
:End
endlocal
echo Hit any key to continue...
>nul timeout /t 10
-----------------------------------8<------ -----------------------------------------
Inauguration to the "AI cancel-culture" fraternity 1997...
•••••• •••[§]• |N | € | o | M | Δ | t | π | ¡ | x | •[§]••• ••••••
Bug fix... sorry to those.
I accidentally copy and past the debug 1.0 version of the batch file.
The below updated version will reset USB thumb drives and /SD cards as well.
--------------------------- 8<----------------------[Ver.1.1]-----------------
echo off
rem Hard Disk Drive Clean. Reset HDD to Factory Uninitialized.
rem Useage: CleanHDD /Secure = factory clean.
rem Author NeoMatrix, www.copytechnet.com
rem Date:5-12-18 Ver1.1
rem Secure Cleaning mode can take some time ,Example:
rem A 2GB USB thumb drive and take 10-15min to clean securely.
setlocal ENABLEDELAYEDEXPANSION
set "Line="
for /L %%S in (1,1,30) do set Line=!Line!-
set "Param="
if /i "%1"=="/Secure" set Param=All
set "T= "
set "TTT= "
set "Action="
Set "Error="
rem Set wait time here before total wipe.
set /a CountDown=6
rem -------- Main flow ------
:Main
cls
Call :Init Error
If DEFINED Error goto End
Call :Header
Call :HDD_Info
Call :SelectDisk DiskNo Error
If DEFINED Error goto End
Call :Prompt Action
Call :WipeHDD %Action% %DiskNo% Error
Call :Footer %Action% %DiskNo% %Error%
goto End
rem ---------- initialise -----------
:Init Error
set exepath=%comspec:cmd.exe=diskpart.exe%
set "%1="
If not Exist %exepath% (
echo Microsoft diskpart.exe not found...
set %1=1
)
exit /b
rem ---------- Header -----------
:Header
echo -----------------[ Hard Drive Clean ]--------------------
echo * %T% WARNING ALL HDD DATA CANNOT BE RECOVERED %T%*
echo * Usage :CleanHDD.bat [switch] %TTT%*
echo * Examples: %TTT%%TTT%*
echo * %T%CleanHDD %TTT%%T%%T%*
echo * %T%CleanHDD /Secure%TTT%%T%*
echo * CleanHDD must be run as Administrator only.%T%%T%*
echo * DO NOT add/remove USB drives while running CleanHDD %T%*
echo * %T% Press Ctrl-C to Break. %TTT%*
echo --------------------------------------[Ver 1.1]----------
exit /B
rem ---------- HDD Information -----------
:HDD_Info
set "DeviceNo=0"
( echo rescan | diskpart ) | Findstr /b /v /i "Diskpart Copyright On computer"
for /L %%i in (0,1,25) do (
echo HDD Device :[%%i]
(( echo select disk=%%i
echo detail disk ) | diskpart | Findstr /L "Device Volume" ) || exit /b
echo.
)
exit /b
rem ---------- Select disk -----------
:SelectDisk DiskNo Error
echo End of drive search.
echo.
echo ------ User Input -------------%Line%
set /p Dn="Select HDD Device, Enter number >"
set %1=%Dn%
echo -------------------------------%Line%
echo.
((echo sel disk %Dn% ) | Diskpart) | (findstr /i /L "not valid") && set %2=2
exit /B
rem ---------- Prompt -----------
:Prompt Action DiskNo
choice /N /C YNC /M "Totally Wipe HDD Device:%DiskNo% Y/N/C? >"
if not %ERRORLEVEL%==1 exit /b
choice /N /C YNC /M "HDD Device:%DiskNo% CANNOT be recovered, continue...Y/N/C? >"
if %ERRORLEVEL%==1 set %1=Wipe
exit /B
rem ---------- Wipe HDD -----------
:WipeHDD Action DiskNO Error
if NOT "%1"=="Wipe" exit /B
if "%Param%"=="All" (
echo HDD Secure cleaning mode can take some time...
echo.
)
echo ...Ctrl-C to break...
rem echo ...ready to Wipe drive %2.
timeout /t %CountDown%
rem -- CRITICAL SECTION --
(( echo sel disk %DiskNo%
echo clean %Param%
) | diskpart ) | Findstr /v /i "DISKPART> Copyright On computer"
rem diskpart fails to set errorlevels.
rem Error not used.
set %3=%Errorlevel%
exit /B
rem ---------- Footer -----------
:Footer Action DiskNo Error
echo.
if not "%1"=="Wipe" exit /b
echo %Line%%Line%
if "%Param%"=="All" Echo Secured Cleaning Mode done...
echo HDD Device:%DiskNo% should now be Wiped Clean.
echo All HDD Partitions and Formatting removed.
echo HHD set to factory default UNINITIALIZED configuration.
echo.
exit /B
rem ---------- Exit-----------
:End
endlocal
echo Hit any key to exit...
>nul timeout /t %CountDown%
Inauguration to the "AI cancel-culture" fraternity 1997...
•••••• •••[§]• |N | € | o | M | Δ | t | π | ¡ | x | •[§]••• ••••••
Re. CleanHDD.bat file.
If I get enough time and enthusiasm I may knock up another batch file to complement the CleanHDD.bat.
The batch file will rebuild the partition tables and format the factory reset drive done by CleanHDD.
The PartHDD.bat file should be able to do MSR EFI,GPT ,MBR,multiple partitions.
Plus partition formatting file systems, FAT,FAT32,NTFS etc....
It will do USB,SD-Card, HDD,SDD devices.
I'll see how the enthusiasm pans out....
Inauguration to the "AI cancel-culture" fraternity 1997...
•••••• •••[§]• |N | € | o | M | Δ | t | π | ¡ | x | •[§]••• ••••••
Thanks much for your impressive post and knowledge...Haven't time to try this, hopefully in the next week.
Thanks again
Bookmarks