Search found 3 matches

by wellard
28 Nov 2014 01:38
Forum: DOS Batch Forum
Topic: Iterate volume letters to find ID
Replies: 7
Views: 5705

Re: Iterate volume letters to find ID

Yury wrote:

Code: Select all

for /l %%# in (90 -1 65) do cmd /c exit /b %%#& 2>nul call vol %%=ExitCodeAscii%%:|>nul find "blah"&& call set tdrive=%%=ExitCodeAscii%%:

Thanks a lot!
by wellard
27 Nov 2014 09:17
Forum: DOS Batch Forum
Topic: Iterate volume letters to find ID
Replies: 7
Views: 5705

Re: Iterate volume letters to find ID

Ok, thanks a lot! Currently code is following: @echo off set "tdrive=" for %%a in (z y x w v u t s r q p o n m l k j i h g f e d c b a) do vol %%a: |find "blah" >nul && set tdrive=%%a: if not defined tdrive echo drive not found & pause >nul & goto :eof pause Is it...
by wellard
27 Nov 2014 05:05
Forum: DOS Batch Forum
Topic: Iterate volume letters to find ID
Replies: 7
Views: 5705

Iterate volume letters to find ID

G'Day, I have ugly code which does what i need: takes letter by letter (Z --> C) in system and check the volume ID ("XXXX-XXXX"). Once correct volume is found, letter is assigned a variable (tdrive) and script proceeds. Here is a code: vol z: | find "XXXX-XXXX" >nul if not errorl...