0

How can I mount one drive as both C and D drive ?

It is currently set as C drive, and I want to also mount it as D drive.

Goal is to have C and D drive pointing to same drive.

Need to do this because everyone else (using one.config file, read by IIS) uses D:\ drive (VirtualMachine) to store data but my physical machine only have C:\ drive

To avoid modifying config file from D:\ to C:\, i want to make my setting the same as everyone else, hence this workaround.

-- update -- neither SUBST nor simple map network drive work with IIS,even though ApplicationPool is run with my own credentials. any idea? this mapping seems to be NOT share-able between logins/sessions

  • This sounds like an XY Problem - could you tell us what you are trying to achieve, rather than how you think you may achieve it? – Tetsujin May 23 '18 at 8:50
  • @Tetsujin edited description of problem – Don Ch May 23 '18 at 8:56
  • share drive c, map drive d to it. – Larryc May 23 '18 at 8:59
  • thanks @Larryc !! so simple. will see if it is not too slow :-) – Don Ch May 23 '18 at 9:07
2

SUBST maps a directory as a drive. It works just as well with the root directory of a drive, so:

SUBST D: C:\

This doesn't persist across logins, so if you want it to happen each time you log in put a .BAT file in your startup folder (usually named something like c:\users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup) containing that line.

Edit: The linked Wikipedia article also suggests a registry method that makes the substitution available to system services like IIS. In the Registry under

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

create a string value with name D: and data \??\C:\. The mapped drive should then appear at the next reboot.

| improve this answer | |
  • neither SUBST nor simple map network drive work with IIS,even though ApplicationPool is run with my own credentials. any idea? this seems to be NOT share-able between logins/sessions – Don Ch May 23 '18 at 9:40
  • @Porton: I've added an alternative suggestion. – john_e May 23 '18 at 10:08
  • magic! it works with tweaking the registry setting, many thanks @john_e :-D – Don Ch May 23 '18 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.