J Turnbull - IT Consultant / Engineer


Go to content

Batch Scripts

Technical Support > Hints & Tips

drives.bat

Used to connect network drives when there is no logon script.

In this instance, drive S: is only mapped if the user has permission to access it.

Edit as required.

@echo off
color 1f
ping -n 1 -w 1 [server ip address]
if %ERRORLEVEL% NEQ 0 goto skip
echo Attempting to connect network drives ...
net use h: \\server ip address\staff$\%USERNAME% /PERSISTENT:NO
net use x: \\server ip address\public /PERSISTENT:NO
net use k: \\server ip address\staffcom$ /PERSISTENT:NO
net use p: \\server ip address\pupils$\ /PERSISTENT:NO

if not exist \\
SIMS server ip address\sims$\ goto skips
net use s: \\
SIMS server ip address\sims$ /PERSISTENT:NO
:skips
goto done

:skip
cls
echo No network present ...
echo.
pause
:done

Home Page | Contact | Technical Support | PAT Testing | Other | Site Map


Back to content | Back to main menu