mapping a drive

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
diskovered
Posts: 2
Joined: 09 Jan 2015 11:48

mapping a drive

#1 Post by diskovered » 09 Jan 2015 12:12

We have two servers, one PRODUCTION and one TEST. I've created two shortcuts on users desktop:

TEST
PROD

The problem is, they both use M drive to access a resource. Essentially, what I want is when I run TEST application on local machine, I want it mapped to M:\testserver\share and vice versa.

When users run TEST, it should disconnect M: and remap this on local machine:

Code: Select all

net use m: /del
net use m: \\testserver\share


When users run PRODUCTION, it should delete disconnect M: and map this to on local machine:

Code: Select all

net use m: /del
net use m: \\productionserver\share


It's not happening. This batch is being ran on the server, not local machine.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: mapping a drive

#2 Post by Squashman » 09 Jan 2015 12:47

diskovered wrote:It's not happening. This batch is being ran on the server, not local machine.

Not understanding what you mean by this. Are you saying they have remote desktop access to the server and are physically running the batch file in the remote session on the server?

If they are running the application from their desktop why would they be running the batch file on the server?

diskovered
Posts: 2
Joined: 09 Jan 2015 11:48

Re: mapping a drive

#3 Post by diskovered » 09 Jan 2015 13:55

This is how users log in to our system:

local machine >
users would then RDP to a virtual workstation >
from virtual workstation they would then click on either PRODUCTION shortcut (\\productionserver\mapped to Y drive ) or TEST (\\testserver\mapped to X drive) shortcuts (batch file)

Both PRODUCTION and TEST application require another file from a separate share. For both PROD and TEST, this share need to be in M drive.

What I want is if they click on PRODUCTION, disconnect M and remap M to \\productionserver\share
When they use TEST, I want the batch file to disconnect M and remap M to \\testserver\share

I know it's confusing. I inherited this setup.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: mapping a drive

#4 Post by Squashman » 09 Jan 2015 14:10

diskovered wrote:they would then click on either PRODUCTION shortcut (\\productionserver\mapped to Y drive ) or TEST (\\testserver\mapped to X drive) shortcuts (batch file)
:?: :?: :?: :?:

Also not understanding what this has to do with the user running the application on their local desktop. Not sure how that could possibly interact with the mapped drive for their RDP session on the server.

Post Reply