OK, I also put together a very similar script. I have found on my lab systems for my "work" environment, that the timing for mapping the network share had to be increased. I also ran into issues were the DUKCY ALT F4 did no close the explorer window as I had hoped. I had to use powershell to kill exploerer. This "work" system is a windows 7 x64 Laptop on a Active Directory Domain. One other weird note, due to certain GPO's we have I had to disconnect the hard wired lan cable to get it to properly map to the Bash bunny. Now , with the faster timing and ALT F4 , I found worked on my non-domain, stand alone windows 10 laptop.
SO as i side note to anyone using in a professional capacity and environment. And with all PROPER PERMISSIONS, of course. May need to adjust timing and do some adjustments for it to work right, depending on any protections the workstation may have.
But I will admit your script is way cleaner than mine.