# Tilde in a image path

I have a problem with a path to a image. The image path looks like this:

``````\includegraphics[]{C:/Users/JOHN~1.WEL/AppData/test.png}
``````

If i put mouse over the image path it shows up but when i try to compile give me some error because of "~". The entire username is JOHN.WELSH

Error is:

``````Missing \endcsname inserted. ^^I^^I}{}
``````

I don't hava alternatives. The path to the image is given in this way(are added automaticaly). How can i add this image in my document using this type of path?

Thank you all.

As `~` is an active character (i.e. is actually a macro) the file path is not a normal string. You need to place a string version of `~`. This can be done by appending the TeX primitive `\string` in front of it.
``````\includegraphics[]{C:/Users/JOHN\string~1.WEL/AppData/test.png}