[tex-live] Windows domains, UNC paths, redirection, special folders

Siep Kroonenberg siepo at cybercomm.nl
Wed May 1 22:50:46 CEST 2013


I updated my virtual Samba Primary Domain Controller installation to
include some redirected special folders and some shares (UNC paths)
which are not mapped to a drive letter. Here some notes which may
help Daleif and maybe others.


GETTING INFORMATION

Several settings are available as environment variables: typing

  set

in a command prompt produces lines of output such as

  APPDATA=C:\Users\siepo\AppData
  USERNAME=siepo
  USERPROFILE=C:\Users\siepo

Other settings are available via the registry: type

  reg query "HKCU\software\microsoft\windows\currentversion\explorer\user shell folders"

in a command prompt. A typical line of output:

  Desktop REG_EXPAND_SZ %USERPROFILE%\Desktop


ROAMING PROFILES AND FOLDER REDIRECTION

With roaming profiles, %USERPROFILE% will be copied to and from a
netwerk share.

In order to cut back on copying at logon and logoff, it is possible
to redirect certain `special folders' to a network share to begin
with and exclude the special folder from copying back and forth. For
instance, the reg query command may output a line such as

  Personal REG_EXPAND_SZ \\VBITMUIS\redirected\%USERNAME%\Documents


UNC PATHS

A UNC path is of the form \\SERVERNAME\SHARENAME . Every share
corresponds with a directory or service on the server.

Many operations and API calls can use UNC paths directly, but
Windows would not be Windows if there weren't some important
exceptions. In particular, on the command-line you cannot cd to a
UNC path.

Instead of fixing this shortcoming of cmd.exe, Microsoft offers a
workaround: if you use pushd rather than cd, then Windows assigns a
temporary drive letter:

  X:\>cd \\VBITMUIS\redirected\siepo\Pictures
  '\\VBITMUIS\redirected\siepo\Pictures'
  CMD does not support UNC paths as current directories.

  X:\>pushd \\VBITMUIS\redirected\siepo\Pictures

  Y:\siepo\Pictures>

Maybe this is how e.g. TeXstudio handles UNC paths.


HOME

Although %USERPROFILE% is the location for configuration data
(%APPDATA%) and special folders, there is still a concept of `home':

  HOMEDRIVE=X:
  HOMEPATH=\
  HOMESHARE=\\vbitmuis\siepo

On a non-domain workstation you would have something like:

  HOMEDRIVE=C:
  HOMEPATH=\Users\siepo

without the HOMESHARE.

A command prompt starts by default in %HOMEDRIVE%%HOMEPATH%, which
makes it necessary to have an actual drive letter for HOME.

-- 
Siep Kroonenberg


More information about the tex-live mailing list