Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbscript to set autoupdate = true for firefox

Status
Not open for further replies.

Briandr

MIS
Jul 11, 2003
177
US
Hi,

Found this batch file and vbscript online that sets auto update = false for Firefox. Seems like it would work. Haven't tested either I would like to reverse it so it would be true and not false. Can someone tell me if the vbscript is correct

:DisableFirefoxUpdate
for /F "tokens=1 delims= " %%a in ('dir "%appdata%\Mozilla\Firefox\Profiles" /b') do
call :DisableFirefoxUpdateSub %%a
goto :DisableFirefoxUpdateEnd
:DisableFirefoxUpdateSub
type "%appdata%\Mozilla\Firefox\Profiles\%1\prefs.js" | find "app.update.enabled" | find "true"
if %errorlevel%==1 echo user_pref("app.update.enabled", true);>>"%appdata%\Mozilla\Firefox\Profiles\%1\prefs.js"
exit /b
:BlockFirefoxUpdateEnd - See more at:
--------------------------------------------------------------------------------------------------------------------------------------------------

Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

sProgPath = GetEnvironmentVariable ("ProgramFiles")
sinstalldir= sprogfiles & "\Mozilla Firefox"

currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName)))

srcFilePath = currentDirectory & "Payload\prefs.js"
destpath = sInstalldir & "\defaults\Profile\"

fso.CreateFolder destpath

fso.copyfile srcFilePath, destpath, TRUE - See more at:
 
Can someone tell me if the vbscript is correct
I can tell you that the vbscript is not correct.

It looks like the original batch file (in the link, not what you posted) would work, but I don't know if your changing "false" to "true" would work. But it should be easy enough for you to test.

If you want to do this in vbscript, and also reverse the behavior to turn autoupdate on, you have to
1) figure out if the original batch file works
2) if so, WHAT makes it work (i.e. what changes it is making to prefs.js to turn autoupdate off)
3) then, figure out what changes to prefs.js need to be made to turn autoupdate on
4) write it in vbscript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top