Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to setup an HTTP proxy on a Windows machine. Problem is, the password has a special character (@) in it that is causing the set command to fail.

I have tried both escaping the character (\@) and percent-encoding it with the hex value (%40), to no avail.

For example, with the username Foo and password B@r, I have tried the following commands:

set http_proxy=http://foo:B\
set http_proxy=

Other than changing the password how can I have the proxy use the password?

share|improve this question
Is the set failing or is the tool using the http_proxy environment variable failing due to the @ symbol? – Mike Cornell Apr 22 '11 at 13:16
Yes. Because the format is username:password@server:port, having @ in the middle of your password causes the right hand side of your password to be considered the hostname, thus the hostname resolution above fails because it thinks the hostname is The "r@" should not be there. – Philluminati Nov 3 '11 at 16:23
I tried using %40 and it worked (on Windows), are you sure? – thegreendroid Oct 29 '12 at 2:32
In fact, it works on both Windows and Linux (Ubuntu). – thegreendroid Oct 29 '12 at 2:55
duplicate… – rofrol Aug 3 '15 at 11:41

You have to percent-encode | encode the special characters. E.g. instead of this:

you write this:

So @ gets replaced with %40.

share|improve this answer
encoding is indeed the way to get around this problem (and many others). – HTDutchy Jan 11 '13 at 12:00

Based upon this answer on SO, can you try using ^ to escape the @ symbol?

share|improve this answer
In response to both, the set is successful, it is the tool using the environment variable: set http_proxy=http://foo:B^ jruby -S gem install rake ERROR: While executing gem ... (URI::InvalidURIError) the scheme http does not accept registry part: (or bad hostname?) – pyropenguin Apr 22 '11 at 15:05
This is a Linux based question, not a Windows based question, using ^ doesn't work for me. I still get wget: unable to resolve host address'` after setting the proxy environmental variable. – Philluminati Nov 3 '11 at 16:19
Actually it IS a Windows based question...I know pyropenguin personally. – Mike Cornell Nov 7 '11 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .