pal2k
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.
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.
I use kixtart. free and plenty of examples. http://www.kixtart.org/
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
I dont have option of installing anything. I have to do with windows dos scripting / wscript or vb script
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what i mean is to re-map without removing the drive map
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?
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.