I am working on a batchfile to modify the prefs.js file of firefox. Basically, I am doing this because FireFox ADM doesn't work well.
So, I am starting like this:
Code: Select all
@echo off
FOR /D %%G in ("%USERPROFILE%\Application Data\Mozilla\Firefox\Profiles\*.default") DO set FirefoxProfile=%%G
THis is working fine, I have found my profile name of firefox. My problem is when I try to read the prefs.js file, I need to find this: user_pref("browser.startup.homepage", "
If this is founded, I want to add a webpage like this: http:\\www.google.ca| (| is if there is another default webpage, it won't delete, but if there is none, a second tab will open)
So, I have some problem getting this trick done. I started this:
Code: Select all
for /f "tokens=*" %%A in ('type "%test%\prefs.js"') do (
SET string=%%A
SET search=user_pref("browser.startup.homepage", "
)
The first part seems to be working except that it echo the last line. I know I am doing something wrong and for the findstr command, I have no idea.
If anyone can help me, I would appreciate it

Thanks!