-1

i want to mount a folder as a drive and share on network, because we use a network based software which wants whole drive (C: or D: or E: etc.) shared over network for a folder inside it, my approach is to mount that folder as a drive and share that virtual drive over network.

i mounted the folder as a drive with subst O: [FOLDER PATH] command but i could not share it on network, it says the folder path could not found.

can you help me please? any other approach is acceptable for me.

Thanks.

Yuzarsif
  • 1
  • 2

2 Answers2

1

This is probably because subst creates only transient mappings, i.e. the mapping will not last over reboots. You can add permanent mappings in the registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices with drive as name (e.g. X:) and the folder as value, prefixed by \??\ (e.g. \\??\C:\\some\folder). The setting is active after a reboot. You can then share this new drive. For later reference, you can also put this into a .reg file and open it:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
"X:"="\\??\\C:\\some\\folder"

This is nicely explained e.g. in the wikipedia SUBST article.

But are you really sure your software insists on the share covering a whole drive? Clients usually don't see or care about the real path on the server. If you want to run the software on the server and it complains there about not having a whole drive, you can also map your share to a drive and run it from there.

Jakob
  • 146
  • 4
  • Dear Jakob thank you very much for a good reply, i will keep this for later reference, i am sure that software want whole drive shared, i have tried to put wanted folder in a folder and shared it with full permissions it did not worked, i also tried to share wanted folder with full permissions it also did not worked, but when i created VHDX disk and put the wanted folder in the disk than i shared whole VHDX disk with full permision it worked perfectly. – Yuzarsif Nov 15 '18 at 09:32
  • forget to mention about the reason why i do not want to share whole drive, because it has some other files which are private and other network users should not see them. and also this kind of approach from software is strange to me, because software is installed in C: drive and wanted folder is located in the same Drive if you want to work with other clients you have to share whole C: drive so other clients software can access it, you can move it to any drive you like on your PC, but again you have to share whole drive. – Yuzarsif Nov 15 '18 at 09:53
0

i found my own solutions like this:

  1. Created a VHDX on Disk management in any where o my pc.
  2. Initialized the VHDX disk
  3. Created New Simple Volume and gave a Drive Letter
  4. Shared the new Drive Over network
Yuzarsif
  • 1
  • 2