|
-
Jul 21st, 2008, 01:41 AM
#1
Thread Starter
New Member
vbs script to change firefox proxy server
So far i have this, I am planning to send this script to a number of people on the network so it changes their proxy server to the correct one.
The trouble is i need to some how implement a part where it gets the folder that is in C:\documents and settings\administrator\application data\mozilla\firefox\Profiles\
Because the part in bold is the profile name, which is different on every computer.
user_pref("network.proxy.autoconfig_url", "http://102.10.0.0:3132/proxy.pac"); - this is the line which is in the firefox settings file
Each user that i will send this too has the same wrong proxy entered so i basicaly wanted to do a search on the file for the line above and replace it with
user_pref("network.proxy.autoconfig_url", "http://10.0.0.1:3132/proxy.pac");
Is this that diffiicult? Please give me your input
Const ForReading = 1
Const ForWriting = 2
firefold = C:\documents and settings\administrator\application data\mozilla\firefox\Profiles\lr3u7j6k.default\prefs.js"
firerep = user_pref("network.proxy.autoconfig_url", "http://102.10.0.0:3132/proxy.pac");
firenew = user_pref("network.proxy.autoconfig_url", "http://10.0.0.1:3132/proxy.pac");
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(" & firefold & ", ForReading)
strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, " & firerep & ", "& firenew & ")
Set objFile = objFSO.OpenTextFile("& firefold & ", ForWriting)
objFile.WriteLine strNewText
Last edited by chmoo; Jul 21st, 2008 at 01:46 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|