On Error Resume Next ' Create the objects that we'll be using Set shell = WScript.CreateObject("WScript.Shell") Set FSO = WScript.CreateObject("Scripting.FileSystemObject") Set NET = WScript.CreateObject("WScript.Network") ' Initialize Variables ProfPath = shell.ExpandEnvironmentStrings("%USERPROFILE%") AppData = shell.ExpandEnvironmentStrings("%APPDATA%") UName = NET.UserName WindowsHome = shell.ExpandEnvironmentStrings("%WINDIR%") TempDir = shell.ExpandEnvironmentStrings("%TEMP%") FFProfPath = AppData + "\Mozilla\Firefox\Profiles\" + UName MyAppPath = Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\")) ' Copy the Global Profile FSO.CreateFolder AppData + "\Mozilla" FSO.CreateFolder AppData + "\Mozilla\Firefox" FSO.CreateFolder AppData + "\Mozilla\Firefox\Profiles" FSO.CopyFolder MyAppPath + "GlobalProfile", FFProfPath ' Copy the shortcuts to the Quick Launch Bar and Desktop FSO.CopyFile MyAppPath + "defaults\shortcuts\Mozilla Firefox.lnk", ProfPath + "\Desktop\Mozilla Firefox.lnk" FSO.CopyFile MyAppPath + "defaults\shortcuts\Mozilla Firefox.lnk", AppData + "\Microsoft\Internet Explorer\Quick Launch\Mozilla Firefox.lnk" ' Make the Firefox folder in the start menu FSO.CreateFolder ProfPath + "\Start Menu\Programs\Mozilla Firefox" ' Copy the shortcuts to the Start Menu FSO.CopyFile MyAppPath + "defaults\shortcuts\Mozilla Firefox.lnk", ProfPath + "\Start Menu\Programs\Mozilla Firefox\Mozilla Firefox.lnk" FSO.CopyFile MyAppPath + "defaults\shortcuts\Mozilla Firefox (Safe Mode).lnk", ProfPath + "\Start Menu\Programs\Mozilla Firefox\Mozilla Firefox (Safe Mode).lnk" ' Create the PROFILES.INI for Firefox ***This part is a hard-core writing of the file*** ' It doesn't matter if it already exists...it's going to get (re)created. If FSO.FileExists(AppData + "\Mozilla\Firefox\Profiles.ini") then FSO.DeleteFile(AppData + "\Mozilla\Firefox\Profiles.ini") End If Set INIFile = FSO.CreateTextFile(AppData + "\Mozilla\Firefox\Profiles.ini", True) INIFile.WriteLine ("[General]") INIFile.WriteLine ("StartWithLastProfile=1") INIFile.WriteLine ("[Profile0]") INIFile.WriteLine ("Name=default") INIFile.WriteLine ("IsRelative=1") INIFile.WriteLine ("Default=1") INIFile.WriteLine ("Path=Profiles/" + UName) INIFile.Close ' Convert the FFProfPath for Chrome (forward slashes and %20 for spaces) ChromePath = Replace(FFProfPath, "\", "/") ChromePath = Replace(ChromePath, " ", "%20") FileContents = GetFile(FFProfPath + "\Chrome\chrome.rdf") dFileContents = Replace(FileContents, "****CHANGETHISSTRING****", ChromePath) WriteFile FFProfPath + "\Chrome\chrome.rdf", dFileContents ' Convert the user's Favorites into bookmarks If FSO.FileExists(MyAppPath + "ftbab.exe") then If FSO.FileExists(FFProfPath + "\bookmarks.html") then FSO.DeleteFile(FFProfPath + "\bookmarks.html") End If CommStr = """" + MyAppPath + "ftbab.exe"" /auto /ftb /fav """ + ProfPath + "\Favorites"" /book """ + FFProfPath + "\bookmarks.html"" /quiet /title Bookmarks" shell.run CommStr, 2, True End if ' Clean up set shell = nothing set FSO = nothing set NET = nothing ' Done! '################## Functions ##################### ' Read a text file as a string Function GetFile(FileName) If FileName <> "" Then Dim FileStream on error resume Next Set FileStream = FSO.OpenTextFile(FileName) GetFile = FileStream.ReadAll End If End Function ' Write string as a text file. Function WriteFile(FileName, Contents) Dim OutStream on error resume Next Set OutStream = FSO.OpenTextFile(FileName, 2, True) OutStream.Write Contents End Function