Agreeing with @Stephan, there is some invisible code change other than use %~dp0, since the path is now also in "double quotes. Most likely, the problem with the first is due to the expansion of the variable %UserProfile%... my guess is there is a space in this line.
No problem using the character #in the file name.
source
share