Mapping Drive Letters

  • Thread starter Thread starter Jason Teagle
  • Start date Start date
J

Jason Teagle

I know about and have been successfully mapping drive letters to network
shares for some time. What I only just found out is that if you try to map a
drive to a directory on the same machine as the mapped drive, it is only
accessible if there is a network present. I had believed that it would be
smart enough to figure out it was a local share and thus route it properly
even without a network present; it seems it blindly accesses the network to
get to the share, and so fails without the network.

The reason I wanted this is because I want to be able to perform operations
(in this case, a compilation of source code) both on my machine at home on
the network, and on my laptop when roaming around client sites. I had copied
all the needed files that are on the network to a local drive on the laptop,
and the hope is that I can map the drive letter to this local drive on the
laptop instead of the network drive - thus, to the files being compiled, it
still has the expected drive letter (for example, the compiler's build file
expects files it needs to come from a P: drive - at home on my machine this
would be mapped to a share on my server, but on the laptop I want this P: to
be a local share that doesn't require the network - the build file thus
doesn't need to be fiddled each time to specify a different drive letter).

Is there a way to achieve this? Is there another way to map P: to
C:\Fake_P_Drive (for example), so that it looks seamless to code?

Thanks in advance.
 
You can accomplish this by using the SUBST command.

For example to map P: to C:\myfolder, Open a command
prompt and type "SUBST p: c:\myfolder" To disconnect the
mapping simply type add a "P: /D".

You can create a shortcut or batch file to run this as
well.

Good Luck

Bob Michon
Associate Expert
 
You can accomplish this by using the SUBST command.
For example to map P: to C:\myfolder, Open a command
prompt and type "SUBST p: c:\myfolder" To disconnect the
mapping simply type add a "P: /D".

You can create a shortcut or batch file to run this as
well.

I had a feeling there was another way - thanks very much.
 
Oops. The command to disconnect should have been "SUBST
P: /D" replacing P: with the letter of the substituted
drive.

Bob Michon
Associate Expert
 
Back
Top