@ECHO OFF

REM \\aecuk.aec.local\SYSVOL\aecuk.aec.local\login.live\common\utils\map_network_drives.vbs bhx1

NET USE * /Delete /Y

NET USE M: \\bhx1sv-dm1\departmental
NET USE G: \\slnas01\shared
NET USE P: \\slnas01\Projects
NET USE S: \\bhx2sv-nas\APPS
NET USE N: \\BHX2SV-NAS\GENERAL

set old_dir=\\bhx1sv-dm1\wa1a_cif0\home\%USERNAME%
set new_dir=\\controlsdata.com\fs\homes\%USERNAME:~0,1%\%USERNAME%

if exist %old_dir% goto :oldmap
if exist %new_dir% goto :newmap

:oldmap
NET USE H: \\slnas01\users\%USERNAME%
goto :EOF

:newmap
NET USE H: \\controlsdata.com\fs\homes\%USERNAME:~0,1%\%USERNAME%
goto :EOF