Disable Firefox Update - VBscript
I have a batch file that disables Firefox update check on the user machines. Can you guys convert the following batch file into a VBscript so it could be pushed out more effectively?
:BlockFirefoxUpdate
for /F "tokens=1 delims= " %%a in ('dir "%appdata%\Mozilla\Firefox\Profiles" /b') do
call :BlockFirefoxUpdateSub %%a
goto :BlockFirefoxUpdateEnd
:BlockFirefoxUpdateSub
type "%appdata%\Mozilla\Firefox\Profiles\%1\prefs.js" | find "app.update.enabled" | find "false"
if %errorlevel%==1 echo user_pref("app.update.enabled", false);>>"%appdata%\Mozilla\Firefox\Profiles\%1\prefs.js"
exit /b
:BlockFirefoxUpdateEnd
:BlockFirefoxUpdate
for /F "tokens=1 delims= " %%a in ('dir "%appdata%\Mozilla\Firefox\Profiles" /b') do
call :BlockFirefoxUpdateSub %%a
goto :BlockFirefoxUpdateEnd
:BlockFirefoxUpdateSub
type "%appdata%\Mozilla\Firefox\Profiles\%1\prefs.js" | find "app.update.enabled" | find "false"
if %errorlevel%==1 echo user_pref("app.update.enabled", false);>>"%appdata%\Mozilla\Firefox\Profiles\%1\prefs.js"
exit /b
:BlockFirefoxUpdateEnd
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
Bruiser
12 years ago
Posted by:
mahendraKumar
12 years ago
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
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