Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We do the same, except you don't need to do it at bootup, you can set it once using the following:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
    "P:"="\\??\\C:\\Dev\\Source"
Change source path accordingly, save as .reg file, import once and it'll stay.

Nice thing about this vs using SUBST is that the SUBST is for your user only, so if you have a separate admin account it won't see it. However the above registry entry is for the machine, so all users on the machine will see it.

Obviously makes it less useful for terminal servers and other shared machines.



I think SUBST can break when you run as administrator (elevating your own privileges).


It still works, but the elevated context maintains a separate list of drive letter mappings, so you need to issue the SUBST command again while elevated.

The same applies to network drive letter mappings.

Under the hood, both are implemented as NT Object Manager symbolic links, which you can see using, e.g.,

https://learn.microsoft.com/en-us/sysinternals/downloads/win...




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: