Link to home
Start Free TrialLog in
Avatar of pal2k
pal2kFlag for United States of America

asked on

Re- map Windows Network Drive using a script

Need to re-map all the windows network drives by any script which works in windows.


Below is the example which shows existing network drive maps and what it should be re-mapped to
-------------------------------
Before re-map

"net use" command on windows command prompt

example:
 F:        \\ABC\SAMPLE\LOGIN
 Y:        \\xyz\SAMPLE\LOGIN


----------------------------------

After re-map


"net use" command on windows command prompt

example:
 F:        \\change1\SAMPLE1\LOGIN
 Y:        \\change2\SAMPLE2\LOGIN



Scenario:-
what ever windows network drives exist with net use command, we need to re-map without
i)deleting or
ii)disconnecting the drive.

If re-map fails for any reason the script should just exist without doing nothing(disconnecting or deleting existing drive mapping)
Which means at any time existing drive mapping should be saved with the exception of re-map is successful.

Its very urgent and any help with this would be really great.
Avatar of BillBondo
BillBondo
Flag of United States of America image

I use kixtart. free and plenty of examples. http://www.kixtart.org/
Avatar of pal2k

ASKER

do we need to install something or it is default in windows

I dont have option of installing anything. I have to do with windows dos scripting / wscript or vb script
ASKER CERTIFIED SOLUTION
Avatar of hypercube
hypercube
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pal2k

ASKER

what i mean is to re-map without removing the drive map
Avatar of pal2k

ASKER

Again whai I mean is if the re-map is not successful , the current existing drive map should not e disturbed
What you mean is

delete the current map
Try and map new share to same drive
if it fails remap the old one back.

Yes?
OK.  Thanks.

Then an IF statement in the batch file would appear to be in order:

IF something then action1 else action2

So, "something" would be a test for if the drive letter exists.  If it exists then action1 can be to delete the prior map.  If not then no action so action2 can be just not there at all.

Sorry I don't have time right now to write the script.  I hope this works.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial