E
Esra Sdrawkcab
Timo Salmi wrote:
> Pegasus (MVP) <I.can@fly.com.oz> wrote:
>> This line works under WinXP:
>> fsutil fsinfo drives|more
>
> One traditional, UNIX-flavored way of getting rid of nul characters in a
> string is using a TR port
>
> fsutil fsinfo drives|tr -d \000
>
> Or SED
> fsutil fsinfo drives|sed -e "s/\x00/ /g"
>
> But indeed, fortunately, the more trick does the same as can be readily
> seen with any hex lister. Also, as was recently discussed in another
> connection, the more conveniently adds a 0D 0A pair at the end of the
> output, if it is missing. Well, in this case it is not.
>
> Not that fsutil fsinfo is the only way of listing ones active drives!
> The code below will give a list of devices that are _ready_
>
> @echo off & setlocal enableextensions enabledelayedexpansion
> for %%d in (a: b: c: d: e: f: g: h: i: j: k: l: m: n:
> o: p: q: r: s: t: u: v: w: x: y: z do (
> dir %%d\ > nul 2>&1
> if !errorlevel! EQU 0 echo %%d
> )
> endlocal & goto :EOF
>
> E.g. one might get
> C:\_D\TEST>cmdfaq
> c:
> d:
> e:
>
> All the best, Timo
>
Mmm I see Ms have dropped the hoary "Abort Retry Ignore" message
> Pegasus (MVP) <I.can@fly.com.oz> wrote:
>> This line works under WinXP:
>> fsutil fsinfo drives|more
>
> One traditional, UNIX-flavored way of getting rid of nul characters in a
> string is using a TR port
>
> fsutil fsinfo drives|tr -d \000
>
> Or SED
> fsutil fsinfo drives|sed -e "s/\x00/ /g"
>
> But indeed, fortunately, the more trick does the same as can be readily
> seen with any hex lister. Also, as was recently discussed in another
> connection, the more conveniently adds a 0D 0A pair at the end of the
> output, if it is missing. Well, in this case it is not.
>
> Not that fsutil fsinfo is the only way of listing ones active drives!
> The code below will give a list of devices that are _ready_
>
> @echo off & setlocal enableextensions enabledelayedexpansion
> for %%d in (a: b: c: d: e: f: g: h: i: j: k: l: m: n:
> o: p: q: r: s: t: u: v: w: x: y: z do (
> dir %%d\ > nul 2>&1
> if !errorlevel! EQU 0 echo %%d
> )
> endlocal & goto :EOF
>
> E.g. one might get
> C:\_D\TEST>cmdfaq
> c:
> d:
> e:
>
> All the best, Timo
>
Mmm I see Ms have dropped the hoary "Abort Retry Ignore" message