I've found this soulution on an other forum, and it worked for me.
Actually, if you are a Windows 10 user (this might apply to Windows 7, 8, and 8.1 as well), the best way to address this issue is to simply create the network shares and assign drive letters as normal and THEN temporarily right click on the drive (make sure it is connected first) and then right-click the mapped drive and select "ALWAYS AVAILABLE OFFLINE." Let Windows start to index and then cancel after a second or two. Now, simply right-click on the same mapped drive and uncheck "ALWAYS AVAILABLE OFFLINE." Let it complete and then reboot. VOILA!! Problem solved. The mapped drives with red "X's" are gone and there is no need to click on each drive to reconnect them anymore. Your welcome!! :) No need to edit registries or use scripts.
Cheers