Skip to main content

Module system_drive

Module system_drive 

Source
Expand description

SystemDrive for a Windows srv started with a bare environment (a headless srv under a service manager, env -i). The shell’s icon and thumbnail caches live in %SystemDrive%\ProgramData\Microsoft\Windows\Caches, and the shell expands that name from the process environment, not from the registry. With the variable missing, the text stays as it is and the shell makes a folder literally called %SystemDrive% in the current directory (#2524). srv sets the variable itself, from the Windows folder, so every child it starts (the file-icon helper first) inherits a real drive.

Functions§

drive_of
The drive of a Windows folder path, as C:: a letter, a colon, nothing else. None for a path that doesn’t start that way (a UNC path, an empty string).
ensure
Give this process a SystemDrive when it has none. Call it before any thread or child exists. A value that is set, whatever it holds, is left alone.
system_drive