Execute batch file to trigger SharePoint’s “Open with Windows Explorer” command

Looking for a shorter route…

My company integrated Teams last year, which has been great, but with it, the embedded SharePoint documents structures has brought on new challenges. Personally, I like to map my most heavily used Teams file folders as network drives for quick access, which is great when they work but….as a result of forced IT updates, my laptop is often rebooted in the middle of the night without any warning or notice to me (a whole other level of frustration). Whenever I log in and attempt to access those mapped network drives, those drives would fail to connect. After researching, I found out why and how to resolve. Basically, the fix was to log in to SharePoint via IE, going to your Documents folder, clicking the link “Return to classic SharePoint”, clicking the Library ribbon, then clicking “Open with Windows Explorer”. Once you do that, all of my linked SharePoint network drives work without issue.

That all said, is there any way to create a batch file to:

  1. Authenticate LDAP credentials when prompted initially from the login.microsoft.com page
  2. Trigger whatever script is opening that Documents folder in Windows Explorer

If feasible, I would look to incorporate that batch in to my startup routine.