Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for mvole.bat

(view source code of mvole.bat as plain text)

  1. @ECHO OFF
  2. CLS
  3. REM  MVol-E ( v2.1 release 1-1-2006 )
  4. REM  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. REM
  6. REM  This program remounts any PHYSICAL volume from the
  7. REM  letter E: to the first available letter R:, T:, V: or X:
  8. REM
  9. REM  Writen by: Jos van der Esch  
  10. REM  E-Mail   : j_vd_esch@hotmail.com
  11. REM
  12. REM *** Check if volume E is in use ***
  13. SET DRVE=?
  14. FOR %%a IN (E) DO (MOUNTVOL %%a: /L >NUL 2>&1 || SET DRVE=%%a:)
  15. IF "%DRVE%"=="?" GOTO BEGIN
  16. GOTO READY
  17. :BEGIN
  18. REM *** Read actual register DriveKey of volume E ***
  19. SET DKEY=?
  20. FOR /F "delims=" %%x IN ('MOUNTVOL E: /L') DO SET DKEY=%%x
  21. REM *** Find first available Free Drive letter ***
  22. SET FDRV=?
  23. FOR %%b IN (X V T R) DO (MOUNTVOL %%b: /L >NUL 2>&1 || SET FDRV=%%b:)
  24. REM *** Check settings ***
  25. IF "%DKEY%"=="?" GOTO READY
  26. IF "%FDRV%"=="?" GOTO READY
  27. REM *** Delete volume E and move it to a new volume ***
  28. MOUNTVOL E: /D
  29. MOUNTVOL %FDRV% %DKEY%
  30. GOTO READY
  31. :READY
  32. CLS
  33. EXIT
  34.  

page last uploaded: 2016-12-15, 11:20