Firefox Proxy Settings via command line

Is there a way to set Firefox Proxy settings via command line? I am on XP workstations.
LVL 1
PeteAsked:
Who is Participating?
 
torimarConnect With a Mentor Commented:
There is no documented way to start Firefox from the command line with a switch for using a specific proxy - if that is what you mean.

You may, however, very well edit the proxy settings from the command line, since they are stored inside "prefs.js", a simple text file located in the user's Mozilla profile folder. The only problem here is the fact that Windows XP does not come with a command line text editor, you would have to 'import' edit.com from a Win2k machine.

But I see you are looking into this for the sake of batch scripting.
A possible way to go about this in a batch file might be to store several modified prefs.js.xxx files, one for each proxy you need to use, and to rename them to prefs.js before calling Firefox.
0
 
PeteAuthor Commented:
OK, great I can see the relevant entries in prefs.js but the path to it is quite unusual
C:\Documents and Settings\Pete\Application Data\Mozilla\Firefox\Profiles\po2piqae.default
The  'po2piqae.default' part seems to be random, so how can I force (xcopy or something) my choosen pefs.js into that path if it's different on every machine, or will it be the same path?
0
 
PeteAuthor Commented:
nearly there I have my prefs.js on C:\ but as far as scripting it goes:

xcopy C:\prefs.js "C:\Documents and Settings\Pete\Application Data\Mozilla\Firefox\Profiles\po2piqae.default" /q /y
works fine..but using a wildcard *:
xcopy C:\prefs.js "C:\Documents and Settings\Pete\Application Data\Mozilla\Firefox\Profiles\*.default" /q /y
says 1 file copied but it doesn't appear, what's going on?

 
0
 
torimarCommented:
Sorry, my internet connection was down for 2 hours.

You got it, profile names always have the ".default" extension. I'd not be too certain that wildcards in path names should work though, especially not when provided within quotation marks.

I think you will have to extract (or pipe) the actual profile name from the \profile directory listing somehow. Unfortunately, my experience in batch file scriptinmg is limited.
0
 
ManicDCommented:
Is this a one of setup of alot of computers or do you need them to be able to switch between proxies?

Are you in a domain enviroment? If so, you could look at using the firefox .adm file to configure settings in group policy

More Information here http://www.frontmotion.com/Firefox/fmfirefox.htm

or google it here http://www.google.co.uk/search?client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial&channel=s&hl=en&q=firefox+.adm&btnG=Google+Search

You could also look at using the adm on the local security policy if you are not in a domain enviroment. You could them simple take the security policy to each station and install it, or use batch scripting to do it.

Ash
0
All Courses

From novice to tech pro — start learning today.