There is also several Firefox add-ons that help with Proxy settings. FoxyProxy being one of the more popular. There was another, that only changed the proxy settings with the command line, but I cannot seem to find it just now.
Just wanted to post the code in a cleaner format... originally posted by sam3344920
cd /D "%APPDATA%\Mozilla\Firefox\Profiles"
cd *.default
set ffile=%cd%
echo user_pref("network.proxy.http", "148.233.229.235 ");>>"%ffile%\prefs.js"
echo user_pref("network.proxy.http_port", 3128);>>"%ffile%\prefs.js"
echo user_pref("network.proxy.type", 1);>>"%ffile%\prefs.js"
set ffile=
cd %windir%
If someone wants to remove the proxy settings, here is some code that will do that for you.
cd /D "%APPDATA%\Mozilla\Firefox\Profiles"
cd *.default
set ffile=%cd%
type "%ffile%\prefs.js" | findstr /v "user_pref("network.proxy.type", 1);" >"%ffile%\prefs_.js"
rename "%ffile%\prefs.js" "prefs__.js"
rename "%ffile%\prefs_.js" "prefs.js"
del "%ffile%\prefs__.js"
set ffile=
cd %windir%
Explaination: The code goes and finds the perfs.js file. Then looks within it to find the line "user_pref("network.proxy.type", 1);". If it finds it, it deletes the file with the /v parameter. The reason I added the rename and delete lines is because I couldn't find a way to overwrite the file once I had removed the proxy line. I'm sure there is a more efficient/safer way of doing this...
@echo off
color 1F
cd /D "%APPDATA%\Mozilla\Firefox\Profiles"
cd *.default
set ffile=%cd%
cd %ffile%
echo user_pref("network.proxy.http", "192.168.1.235 ");>>"prefs.js"
echo user_pref("network.proxy.http_port", 80);>>"prefs.js"
echo user_pref("network.proxy.type", 1);>>"prefs.js"
set ffile=
cd %windir%
Thank very much, I find the answers in this website.
Here I refer to the production of a cmd file
by minimo
cd /D "%APPDATA%\Mozilla\Firefox\Profiles"
cd *.default
set ffile=%cd%
echo user_pref("network.proxy.http", "192.168.1.235 ");>>"%ffile%\prefs.js"
echo user_pref("network.proxy.http_port", 80);>>"%ffile%\prefs.js"
echo user_pref("network.proxy.type", 1);>>"%ffile%\prefs.js"
set ffile=
cd %windir%
where "7b9ja6xv" is a random string. However, the directory of the default profile always ends in ".default". Most of the time there will be only one profile anyway.
Setting you are after are named "network.proxy.http" and "network.proxy.http_port".
Now it depends on what technology you are able/prepared to use to change the file.
P.S.: If this is about changing the proxy settings of a group of users via the logon script or similar, I recommend looking into the possibility of using the automatic proxy discovery (WPAD) mechanism. You would never have to change proxy configuration on a user machine again.
There is also several Firefox add-ons that help with Proxy settings. FoxyProxy being one of the more popular. There was another, that only changed the proxy settings with the command line, but I cannot seem to find it just now.
Mozilla's FoxyProxy Page
Just wanted to post the code in a cleaner format... originally posted by sam3344920
If someone wants to remove the proxy settings, here is some code that will do that for you.
Explaination: The code goes and finds the perfs.js file. Then looks within it to find the line "user_pref("network.proxy.type", 1);". If it finds it, it deletes the file with the /v parameter. The reason I added the rename and delete lines is because I couldn't find a way to overwrite the file once I had removed the proxy line. I'm sure there is a more efficient/safer way of doing this...
Thank very much, I find the answers in this website.
Here I refer to the production of a cmd file
by minimo
The proxy setting is stored in the user's
prefs.js
file in their Firefox profile.The path to the Firefox profile directory and the file is:
where "
7b9ja6xv
" is a random string. However, the directory of the default profile always ends in ".default". Most of the time there will be only one profile anyway.Setting you are after are named "
network.proxy.http
" and "network.proxy.http_port
".Now it depends on what technology you are able/prepared to use to change the file.
P.S.: If this is about changing the proxy settings of a group of users via the logon script or similar, I recommend looking into the possibility of using the automatic proxy discovery (WPAD) mechanism. You would never have to change proxy configuration on a user machine again.