Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to change IE proxy settings from command line

I am looking for options which will allow me change connection proxy information of IE thru command line.

like image 922
balalakshmi Avatar asked Feb 15 '10 10:02

balalakshmi


People also ask

How do I open proxy settings in CMD?

Click Start, click Run, type cmd, and then click OK. At the command prompt, type netsh winhttp show proxy, and then press ENTER.

How do you change proxy settings in a script?

To set up a proxy server using a setup scriptSelect the Start button, then select Settings > Network & Internet > Proxy. If you or your organization uses a setup script, turn on Use setup script. In the Script address box, enter the script address, then select Save.


2 Answers

IE proxy settings are controlled via registry keys. In general you should change them manually since this implementation detail can change between versions. However, as a debugging tool its useful.

Anyway, you can change registry keys from the command line using the REG command. Specifically, I would just create some .reg files with the various states you want to change to and do REG IMPORT example-file.reg. Or, failing that, REG ADD.

like image 62
i_am_jorf Avatar answered Oct 14 '22 18:10

i_am_jorf


proxycfg might be the tool you are looking for.

C:\>proxycfg /?
Microsoft (R) WinHTTP Default Proxy Configuration Tool
Copyright (c) Microsoft Corporation. All rights reserved.

usage:

    proxycfg -?  : to view help information

    proxycfg     : to view current WinHTTP proxy settings

    proxycfg [-d] [-p <server-name> [<bypass-list>]]

        -d : set direct access
        -p : set proxy server(s), and optional bypass list

    proxycfg -u  : import proxy settings from current user's
                   Microsoft Internet Explorer manual settings (in HKCU)

It works well in windows XP
In next windows versions, you can use:

C:\>netsh winhttp import proxy source=ie

to import proxy settings from Internet Explorer and

C:\>netsh winhttp reset proxy

to reset proxy settings for more help, use:

C:\>netsh winhttp /?

But these changes might not get reflected in Internet Explorer. Nonetheless, you should be able to use proxy in command line applications.

like image 27
Srichakradhar Avatar answered Oct 14 '22 19:10

Srichakradhar