DEV Community

IT Command
IT Command

Posted on

How to handle Explanation Point in a Batch file

Hello Everyone, Today I come to you with another strange problem. My friend Josiah has a username which gets him into a lot of trouble. His username is "Josiah!". The problem with this username is that in a batch file where you do something like


Start "C:\Users\%username%\Desktop\File.exe"

it uses the ! in his username and that crashes the prompt. I was wondering if anyone knew a way around it? Thanks! -Luke.

Oldest comments (1)

Collapse
 
it_command profile image
IT Command

I contacted Microsoft and apparently it is an extremely rare bug and most of the time you cannot put exclamation marks in a username!