Description
This backs up the current mapped drives and their letters to a temporary file called _%computername%_maps.txt and then installs them exactly as they were, same drive letters, same paths.
For this to work you need to export the credentials off windows using How to Backup and Restore Windows Vault Passwords

Example usage: backup the drives using the first code, then install them using the second code.


Backup Script
create a .cmd file, name it whatever you want and add:
Code:
net use >> _%computername%_maps.txt

Install script
create a .cmd file, name it whatever you want and add:
Code:
pushd %~dp0
setlocal enabledelayedexpansion

for /f "tokens=* delims= " %%a in ('type _%computername%_maps ^| find "\\"') do (
  @for /f "tokens=2 delims= " %%b in ('echo %%a') do set letter=%%b
    @for /f "tokens=3 delims= " %%c in ('echo %%a') do set server=%%c
      call :mountdrive !letter! !server!
)

:mountdrive
if /i "%~d1" NEQ "%~1" net use %1 & goto :eof
net use %1 %2
goto :eof