Welcome, guest | Sign In | My Account | Store | Cart

Another way to check mounted drives (this method has a bug with cdrom).

Batch, 17 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
@echo off
  setlocal
    set "s=%~n0 v1.01"
    echo %s% - mounted devices
    echo Copyright (C) 2013 greg zakharov gregzakh@gmail.com
    echo.
    ::volumes and drives
    for /f "tokens=* delims= " %%i in ('mountvol ^| findstr \\') do (
      if "%%~di\" neq "%%i" (echo Volume: %%i) else (echo    Mounted at: %%i)
      ::ids
      for /f "tokens=2 delims=:" %%j in ('2^>nul vol %%~di') do (
        echo    Volume ID:%%j
        echo.
      )
    )
  endlocal
exit /b
Created by greg zakharov on Mon, 19 Aug 2013 (MIT)
Batch recipes (42)
greg zakharov's recipes (59)

Required Modules

  • (none specified)

Other Information and Tasks