FInd and modify string in prefs.js (FireFox)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ChristB
Posts: 2
Joined: 13 Jan 2015 15:29

FInd and modify string in prefs.js (FireFox)

#1 Post by ChristB » 15 Jan 2015 09:17

Hi guys,

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!


ChristB
Posts: 2
Joined: 13 Jan 2015 15:29

Re: FInd and modify string in prefs.js (FireFox)

#3 Post by ChristB » 15 Jan 2015 15:59

Hi,

thanks, yeah sorry, I didn't really search, and I know I should have :arrow:

Thanks again!

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: FInd and modify string in prefs.js (FireFox)

#4 Post by Squashman » 15 Jan 2015 16:20

ChristB wrote:Hi,

thanks, yeah sorry, I didn't really search, and I know I should have :arrow:

Thanks again!

No worries. I usually just use Google to search the site. I usually get better results that way.

Post Reply