39 lines
602 B
Batchfile
39 lines
602 B
Batchfile
![]() |
@echo off
|
||
|
set T=c:\TEMP
|
||
|
set DPARTSCRIPT=%T%\diskpart.txt
|
||
|
|
||
|
rem create temp directory ...
|
||
|
mkdir %T% 1>nul 2>nul
|
||
|
|
||
|
rem =====
|
||
|
rem MAIN
|
||
|
rem =====
|
||
|
|
||
|
echo Removing Drive Letter ...
|
||
|
echo.
|
||
|
|
||
|
> %DPARTSCRIPT% (
|
||
|
@echo.select disk 0
|
||
|
@echo.select partition 2
|
||
|
@echo.remove all dismount
|
||
|
@echo.exit
|
||
|
@echo.
|
||
|
)
|
||
|
|
||
|
diskpart /s %DPARTSCRIPT%
|
||
|
if %ERRORLEVEL% NEQ 0 (
|
||
|
echo ERROR: while removing the drive letter!
|
||
|
del /F %DPARTSCRIPT% 1>nul 2>nul
|
||
|
exit /b
|
||
|
)
|
||
|
echo Drive letter removed.
|
||
|
|
||
|
rem cleanup ...
|
||
|
del /F %DPARTSCRIPT% 1>nul 2>nul
|
||
|
|
||
|
echo.
|
||
|
echo ======
|
||
|
echo READY.
|
||
|
echo ======
|
||
|
|