I am posting a working bat file to automate network drive and shortcut for AD users. This bat file works excellent if you desire to push network drive through AD logon script. You can copy these in a notepad and save it as filename.bat and put this bat file in \\yourserver\sysvol\yourdomainname\scripts folder.
Here is sample file.
@echo off
echo ! _________________________ !
echo ! !
echo ! MAPPING NETWORK DRIVES !
echo ! !
echo ! * * * LEAVE OPEN * * * !
echo ! OR IT WILL NOT MAP YOUR DRIVES !
echo ! !
echo ! _________________________ !
net use r: \\yourserver\data
REM
copy “\\yourserver\data\Shortcuts\company policy.lnk” “C:\Documents and Settings\%username%\Desktop\”
Here \\yourserver\data is the path of the folder. Make sure you got appropriate permission setup in network drive i.e. NTFS permission applied in the folder you want to use as network drive. Now go to Active Directory users and computers. Select number of users or individual user and right click on selected and click on to properties. Go to profile and type filename.bat in log on script box.