So we just discovered this weird quirk. Easy enough to avoid but curious if any of the experts here know what's happening.
It seems that if you try to use the right-click "Run as Administrator" on a batch file that contains a space and an @ symbol in the path, it will fail to launch. It will run fine in a normal context, or in a command prompt that you previously elevated, but this specific set of circumstances causes it to unceremoniously fail.
I did some searching online and the only other reference I could find was a post where a user named CapnM had a similar problem and discovered the same issue - back in 2015
The right-click, Run As Administrator function in File Explorer fails if the path to the target contains both an at sign (@) and a space.
For example these paths work:
D:\foo\bar\foobar\ D:\foo\bar\foo bar\ D:\@foo\bar\foobar\ D:\@foo\bar@\foobar\But these prevent the target (batch file) from running:
D:\@foo\bar\foo bar\ D:\foo\bar\@foo bar\
Is this just a straight up bug that hasn't been fixed for 4+ years?
