Hello. I'm not really sure if this was documented before. But, some seconds ago I found this for error and I'm really surprised and happy of the result.
I using Windows 7.
I found that SUBST command accept other letters in the drive letter (not the typical A-Z of all the life), but Windows Explorer only shows the A-Z letters:
I use for example:
SUBST $: "%TEMP%"
And now you not view the $ in the window explorer, but if you use:
No, you have in the Temp directory, but mapped with the volume $:
Also, I use:
SUBST :: "%TEMP%" SUBST !: "%TEMP%" SUBST 9: "%TEMP%"
and many other characters.
Then, this have some benefits. You can map a folder as a volume inside a batch, and you not view this in the explorer of windows. Also, you can increment the possibilities of map a drive letter unused.
Also, I found that subst command executed without parameters, show the folder mapped with it, but only A-Z
If you use for example:
SUBST #: "%TEMP%" SUBST B: "%TEMP%"
And you run SUBST you get:
B:\: => C:\Users\Carlos\AppData\Local\Temp
but you not be informed of the existence of #: you only can remember it.
Last edited by carlos (27 Nov 2012 09:26)
I have added a note about this to the SUBST page - thanks Carlos
I read this post a while ago and something was nagging me about it. Do any of these show up when you type 'set "' at the CMD prompt? (That's S E T <space> <double-quote> ) The so-called 'undocumented system variables' should include the names of whatever directories are current on whatever various hard drives you have, etc. (There won't be any in the list if you haven't referenced any in your current console session.)
----------screen capture Win 7------------------
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
etc., etc., etc.,
-----------end screen capture---------------------
I have some SUBSTs in effect but only in WinXP under WinVPC
H:\: => UNC\tsclient\c
K:\: => UNC\tsclient\k
X:\: => UNC\tsclient\f
to access the host Win 7 hard drive; these don't show up for
me in the output of 'set "'.
Univ. of California, Berkeley
ude tod yelekreb ta nyborp
Yes - They show up for me in Win7 once the mapped drive is referenced. The variable remains even after the mapped drive is undefined!
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. P:\>set ^"|findstr "^=" =P:=P:\ P:\>subst $: "%temp%" P:\>set ^"|findstr "^=" =ExitCode=00000000 =P:=P:\ P:\>$: $:\>p: P:\>set ^"|findstr "^=" =$:=$:\ =ExitCode=00000000 =P:=P:\ P:\>subst $: /d P:\>set ^"|findstr "^=" =$:=$:\ =ExitCode=00000000 =P:=P:\ P:\>$: The system cannot find the drive specified. P:\>set ^"|findstr "^=" =$:=$:\ =ExitCode=00000000 =P:=P:\ P:\>
Esto me ha gustado bastante, siempre me he apegado a las "reglas de sintaxis" de cada comando y en base a ello hago cosas, tu experimentas nuevas posibilidades
el comando SUBST es la base del script de "Virtual Drive" (si lo recuerdas) y con este descubrimiento quedaria aun mejor al no reflejarse en el explorador cual es la unidad que usa para guardar las cosas, o hacer algo aun mejor