I fixed %~dp0 and set the other errors turned out to all be related to the if command. I didn't know there could be if blocks, and I didn't know if could work without ( and ), and I didn't know if had any options either! I'm really learning a lot today!