Skip to content

Instantly share code, notes, and snippets.

@Zingam
Created March 14, 2016 14:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zingam/a412cae5b7c587d9355e to your computer and use it in GitHub Desktop.
Save Zingam/a412cae5b7c587d9355e to your computer and use it in GitHub Desktop.
Create persistent drive subst of a folder
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: This command will create a persistant drive subst of a folder accross
:: reboots and will also be available to command prompts with raised
:: privileges.
::
:: Example:
:: "C:\Users\HGH\Documents\Programming" will be mapped to drive "X:\"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: For details see:
:: http://superuser.com/questions/29072/how-to-make-subst-mapping-persistent-across-reboots
:: https://github.com/cyberponk/psubst
:: http://answers.microsoft.com/en-us/windows/forum/windows_7-files/is-the-subst-command-broken-in-windows-7/4855524d-a28b-403e-8d7e-515926e01aaa
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices" /v X: /t REG_SZ /d "\??\C:\Users\HGH\Documents\Programming" /f
@sergeevabc
Copy link

Beware, this edition adds /f switch to the registry as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment