Below is a sample script that I use on my network to map drives for users to the D-Link DNS-343. Items in braces require input to customize the script to your network environment. Save this file with an extension of .bat to make it executable. On my network, I have shares for each user, a shared folder for everyone, a shared calendar share, and a share of downloads, etc. The script asks the user for his/her DNS-343 username and password and then passes that to the net use statements for authentication and to find the correct user folder on the NAS.
@echo off
color 18
cls
set device=[Enter the Device IP or internal DNS name here]
@echo Please enter the following network information
echo.
set /p user=Please enter your network username:
set /p pass=Please enter your network password:
echo.
@echo mapping drives on nas device
echo.
net use h: \\%device%\%user% /user:%user% %pass% /persistent:no
net use p: \\%device%\shared /user:%user% %pass% /persistent:no
net use q: \\%device%\calendars /user:%user% %pass% /persistent:no
net use r: \\%device%\downloads /user:%user% %pass% /persistent:no
pause
exit