Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- SET _label=RAMDISK
- SET _letter=R:
- echo list volume > %systemdrive%\dps.tmp
- diskpart /s %systemdrive%\dps.tmp > %systemdrive%\volumes.tmp
- FOR /F "tokens=2-4" %%A IN ('type %systemdrive%\volumes.tmp') DO IF /I "%%C"=="%_label%" set _number=%%A
- if DEFINED _number (
- echo select volume %_number% > %systemdrive%\dps.tmp
- echo assign letter=%_letter% >> %systemdrive%\dps.tmp
- diskpart /s %systemdrive%\dps.tmp
- )
- DEL /F /Q %systemdrive%\dps.tmp
- DEL /F /Q %systemdrive%\volumes.tmp
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement