There are two ways to map a network drive and each is more useful in a different situation.
This way is the more efficient of the two and most useful if the network path never changes.
If not exist P: net use P: \\server\networkshare
This method is more useful if the network share changes from time to time.
net use P: /del net use P: \\server\networkshare
Something else to consider
Another thing to consider is adding an echo line of text before you map the drive to inform the user of what’s happening. Just so they don’t think that nothing is going on. An example of this would be:
echo Setting up P Drive