A far from ideal solution, is mklink, as it's not creating a new drive, but it is creating a directory on your local drive, that links to a network drive.
mklink doesn't have the problem that you are running into, that net use and subst have, which is that administrative cmd prompts and non-administrative cmd prompts can't see the results of each others net use or subst mappings.
You can use mklink, (some don't realise that mklink can be used for network "shares"). By the way likewise net use can be used for local directories too, just net use
has the issue, as does subst(subst of course can't link to network drives).
Creating a symbolic link to mapped network drive in Windows
C:\Windows\system32>mklink /d c:\asdfbba \\192.168.0.30\carp
symbolic link created for c:\asdfbba <<===>> \\192.168.0.30\carp
C:\Windows\system32>dir c:\asdfbba
Volume in drive C has no label.
Volume Serial Number is 4645-5DCE
Directory of c:\asdfbba
25/01/2022 20:31 <DIR> .
25/01/2022 20:31 <DIR> ..
25/01/2022 20:31 126 blah.txt
1 File(s) 126 bytes
2 Dir(s) 424,086,941,696 bytes free
C:\Windows\system32>
One weakness of mklink compared to net use
, is that with mklink you can't specify a new drive letter. mklink will happily create whatever link, just not whatever drive.
C:\Windows\system32>mklink /d c:\asdfbbadsfsff \\192.168.0.30\acrp
symbolic link created for c:\asdfbbadsfsff <<===>> \\192.168.0.30\carp
C:\Windows\system32>mklink /d n:\asdfbbadsfsff \\192.168.0.30\carp
The system cannot find the path specified.
C:\Windows\system32>
You could make a c:\nw directory to make clearer that a thing in there is on the network, and you could get the link to be to c:\nw\blahcomp\carp
for shared directory \\192.168.0.30\carp
. You'd have to mkdir c:\nw\blahcomp
then mklink /d c:\nw\blahcomp\crp \\192.168.0.30\carp
(when you give mklink the first argument / the first actual parameter, if it's just one level then it isn't funny, but if it's multi-level e.g. c:\blah\bleh
that you want to be your local link, then it willl create the last subdirectory (bleh), but you have to mkdir the parent of it.