samintz
Scott Mintz
- May
- 1,590
- 27
Dan,
Your message seems to have vanished. Here's my reply to it anyway:
-=-=-=-=-=-=-
I think there may be something in the tips & techniques section on this. However I use this approach:
While the above function works, it's not efficient in that it reruns SUBST every time it is invoked. That's good if your SUBST'ed drive list changes often. It might be better to assign the output to an environment variable and use that.
FWIW, on my system I have drives QRTVWYZ subst'ed.
-Scott
Your message seems to have vanished. Here's my reply to it anyway:
-=-=-=-=-=-=-
I think there may be something in the tips & techniques section on this. However I use this approach:
Code:
[R:] function IsSubst=`%@if[%@index[%@execstr[do d in /p subst (echos %%@left[1,%%d])],%@left[1,%1]] NE -1,1,0]`
[R:] echo %@IsSubst[C:]
0
[R:] echo %@IsSubst[%_CWD]
1
While the above function works, it's not efficient in that it reruns SUBST every time it is invoked. That's good if your SUBST'ed drive list changes often. It might be better to assign the output to an environment variable and use that.
Code:
unset /q sl & do d in /p subst (set sl=%[sl]%@left[1,%d])
function IsSubst=`%@if[%@index[%sl,%@left[1,%1]] NE -1,1,0]`
FWIW, on my system I have drives QRTVWYZ subst'ed.
-Scott