I want to write a start up script to take an mapped drive, change the drive letter, then put a different share on the original drive. How can this be done?
If for example the existing drive is X: and has \server1\shareA on it and you wanted to remap X: to Y:you could do it with a batch script.
If you need to pass credentials you'd have to add the username (and possibly the password if you want it to run totally automated. Note that it's a bad idea to do this with privileged accounts and there are way smarter ways. But for a quick change over this will do it
If you don't include the password it will prompt. You can save this in a .bat file and it will run just fine.
EDITED TO ADD more complete solution
So you want to take a drive mapping X: change it to Y: and then connect X: to the new share \server1\newshare? Here you go. You can of course still pass credentials if necessary.
Check out the NET USE command.
You will need to delete the current mapping, then remap with the desired drive letters and shares.