views:

36

answers:

1

How can I change Firefox's proxy settings from a script like a vb script or maybe .net? If someone could show me how to do this it would be great.

A: 

You can do it by writing to the prefs.js file, however, my understanding is that this file is only loaded on startup, and Firefox might overwrite your changes when shutting down so I think the only safe way of doing this would be to:

  1. Shut down all Firefox processes.
  2. Change prefs.js.
  3. Start up Firefox.

This Code project article should show you how to close down a process from vbscript: DestroyWindow in VBScript

You can use the FileSystemObject to read/write to files.

I think something like this would work for starting it up again:

Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & "PathToFireFox.exe" & Chr(34), 1, false
ho1