Hi,
I've written the following login batch file to check to see if the drive exists, if found unmaps, then remaps the drive to the letter I've selected.
The issue is sometimes when the drive is already mapped, the script won't disconnect from the drive, so the drive won't map later in the script. On consective runs of the script will disconnect the drive. This is a shortened version of the script, but I have 6 drives I want mapped.
Any help would be greatly appreciated.
@echo off
if exist f: goto drivefound2 else
goto end
:drivefound2
net use f: /del
:end
pause
if exist l: goto drivefound3
goto end
:drivefound3
net use l: /del
:end
pause
if exist r: goto drivefound4
goto end
:drivefound4
net use r: /del
:end
pause
net use f: \\drivea
net use l: \\driveb
net use r: \\drivec
:END
echo DONE!
I've written the following login batch file to check to see if the drive exists, if found unmaps, then remaps the drive to the letter I've selected.
The issue is sometimes when the drive is already mapped, the script won't disconnect from the drive, so the drive won't map later in the script. On consective runs of the script will disconnect the drive. This is a shortened version of the script, but I have 6 drives I want mapped.
Any help would be greatly appreciated.
@echo off
if exist f: goto drivefound2 else
goto end
:drivefound2
net use f: /del
:end
pause
if exist l: goto drivefound3
goto end
:drivefound3
net use l: /del
:end
pause
if exist r: goto drivefound4
goto end
:drivefound4
net use r: /del
:end
pause
net use f: \\drivea
net use l: \\driveb
net use r: \\drivec
:END
echo DONE!