;

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
carlitos.dll
Posts: 11
Joined: 02 Jul 2008 07:42

;

#1 Post by carlitos.dll » 02 Jul 2008 07:49

The author has been removed this message.
Last edited by carlitos.dll on 30 Sep 2011 22:54, edited 5 times in total.

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#2 Post by DosItHelp » 03 Jul 2008 23:56

carlitos.dll

Thanks for sharing, haven't tried you solution but isn't this shorter?

Code: Select all

@echo off
set "removableDr="
set "drlist="
for /f "tokens=*" %%a in ('fsutil fsinfo drives^|find /v ""') do (
    set dr=%%a
    call set "drlist=%%drlist%% %%dr:~-3%%"
)
for %%a in (%drlist%) do (
    fsutil fsinfo drivetype %%a|find /i "Removable drive">NUL&&(
        call set "removableDr=%%removableDr%% %%a"
    )
)
echo removable drives: %removableDr%


:wink:

Post Reply