.
This commit is contained in:
parent
5b56e8c1e0
commit
b8e94d7a1e
38
scripts/remove_drive_letter.cmd
Normal file
38
scripts/remove_drive_letter.cmd
Normal file
@ -0,0 +1,38 @@
|
||||
@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 ======
|
||||
|
Loading…
Reference in New Issue
Block a user