onlyrasel Posted April 24, 2011 Share Posted April 24, 2011 I need a script that can make a default homepage for Firefox and Internet Explorer Link to comment Share on other sites More sharing options...
allen2 Posted April 24, 2011 Share Posted April 24, 2011 For firefox you'll need to edit pref.js in the user profile and set it there:pref("browser.startup.homepage", "http://www.msfn.org");For IE, it's a reg entry in HKCU:HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MainStartpage="http://www.msfn.org"Begin by trying to make something, instead of asking other to make it. Link to comment Share on other sites More sharing options...
onlyrasel Posted April 24, 2011 Author Share Posted April 24, 2011 Thanks bro. Its working. Any script for this. Actually I'm new in coding. Link to comment Share on other sites More sharing options...
submix8c Posted April 24, 2011 Share Posted April 24, 2011 Begin by trying to make something, instead of asking other to make it.Thanks bro. Its working. Any script for this. Actually I'm new in coding.You have to make your own script using whatever scripting language works (or that you are learning). Google on the scripting language you want to learn and do a little "light reading". (Doesn't VBS allow for all of the functions necessary?)Try a Script that you think should work and if it doesn't then ask for help correcting it. Link to comment Share on other sites More sharing options...
allen2 Posted April 24, 2011 Share Posted April 24, 2011 This kind of script could be done in almost every script language and a google search would have at least showed how to do it for IE but depending on the OS it might be better to use one language or another.Autoit can do it very easily (i saw you said in another post you did a silent install with it). Link to comment Share on other sites More sharing options...
Tripredacus Posted April 25, 2011 Share Posted April 25, 2011 For IE, you can download AutoIT and look up RegWrite in the help file. Link to comment Share on other sites More sharing options...
radix Posted May 14, 2011 Share Posted May 14, 2011 AutoIt approach:#Include <Array.au3>#Include <File.au3>; Check if Mozilla Firefox x86 version is installedIf @OSArch = "X86" Then $MozillaFirefoxCurrentVersion = RegRead("HKLM\SOFTWARE\Mozilla\Mozilla Firefox", "CurrentVersion") $MozillaFirefoxInstallDirectory = RegRead("HKLM\SOFTWARE\Mozilla\Mozilla Firefox\" & $MozillaFirefoxCurrentVersion & "\Main", "Install Directory")EndIfIf @OSArch = "X64" Then $MozillaFirefoxCurrentVersion = RegRead("HKLM\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox", "CurrentVersion") $MozillaFirefoxInstallDirectory = RegRead("HKLM\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\" & $MozillaFirefoxCurrentVersion & "\Main", "Install Directory")EndIf$MozillaFirefoxExecutableFile = FileExists($MozillaFirefoxInstallDirectory & "\firefox.exe")If $MozillaFirefoxExecutableFile = 0 Then MsgBox(0x40010, @ScriptName, "Mozilla Firefox is not installed! Please install it and then run this script!", 4) ExitEndIf; Find Mozilla Firefox profile folderIf FileExists(@AppDataDir & "\Mozilla\Firefox\profiles.ini") Then $Mozilla_Firefox_profile_folder = IniRead(@AppDataDir & "\Mozilla\Firefox\profiles.ini", "Profile0", "Path", "") $Mozilla_Firefox_profile_folder = StringReplace($Mozilla_Firefox_profile_folder, "/", "\")EndIf; EDIT MOZILLA FIREFOX PREFERENCES FILE$InputFile = @AppDataDir & "\Mozilla\Firefox\" & $Mozilla_Firefox_profile_folder & "\prefs.js"; String to find$StringToFind = '"browser.startup.homepage"'; New home page address$HomePageAddress = "" ; write the desired home page address (inside quotes), for example: http://www.google.com/; Delete the current home page addressGlobal $Array_FileReadToArray ($InputFile, $Array)$Array = _DeleteHomePageAddress ($Array, $StringToFind)_FileWriteFromArray ($InputFile, $Array, 1); Write a new home page address$File = FileOpen($InputFile, 257) ; UTF8 encoding without BOMFileWriteLine($File, 'user_pref("browser.startup.homepage", ' & '"' & $HomePageAddress & '"' & ');')FileClose($File)Func _DeleteHomePageAddress ($Array, $StringToFind) Local $Item For $Element In $Array If StringInstr ($Element, $StringToFind) <> 0 Then _ArrayDelete ($Array, $Item) Else $Item+=1 EndIf Next Return ($Array)EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now