Map network drives when VPN connects

An ethernal problem. Here is how to fix it:

First connect to a VPN connection and then go into the Program logs in Event viewer ( Windows key + R then eventvwr )

Go to the Program log and find the success post for the connection just made. EventID on mine here is 20225.

Then open Task Scheduler (Windows + R then taskschd.msc)

Create a new task and name it something. On the trigger select on a Event, then select the log Application, Source RasClient, and then type in the EventID you found when the connection was made successful. In my case 20225.

Then on Actions, add a bat file with the command net use commands for your share.

(net use x: \\172.20.0.20\share /user:username password /persistent:yes)

Now press ok and test.

Enjoy