Advertisement
tomearp

RAMDiskRename.bat

Feb 7th, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. @echo off
  2. SET _label=RAMDISK
  3. SET _letter=R:
  4.  
  5. echo list volume > %systemdrive%\dps.tmp
  6. diskpart /s %systemdrive%\dps.tmp > %systemdrive%\volumes.tmp
  7.  
  8. FOR /F "tokens=2-4" %%A IN ('type %systemdrive%\volumes.tmp') DO IF /I "%%C"=="%_label%" set _number=%%A
  9.  
  10. if DEFINED _number (
  11. echo select volume %_number% > %systemdrive%\dps.tmp
  12. echo assign letter=%_letter% >> %systemdrive%\dps.tmp
  13. diskpart /s %systemdrive%\dps.tmp
  14. )
  15.  
  16. DEL /F /Q %systemdrive%\dps.tmp
  17. DEL /F /Q %systemdrive%\volumes.tmp
  18.  
  19. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement