Copy Firefox pref using batch

April 2, 2009 at 13:07:34
Specs: Windows XP
I am trying to push out a preferences file to all
the computers in the organization I work at for
Firefox. Firefox creates a random profile name
unique to that user so to place the prefs file in
their directory I would need to know their
random profile which I cannot know. I am
wondering if there is a script replacement to
specify a folder that I don't know the name of.
I tried this command but it says invalid syntax.

copy "\\Network Path\prefs.js" "C:\Documents
and Settings\%USERNAME%\Application
Data\Mozilla\Firefox\Profiles\*.default\"

I did this because the profiles created are in a
directory with 8 random characters then
.default (xxxxxxxx.default) but this is invalid
syntax. Any ideas on how to do this would be
great thanks in advance.


See More: Copy Firefox pref using batch

Report •


#1
April 2, 2009 at 18:15:35
FOR /D %%a IN (""C:\Documents and Settings\%USERNAME%\Application Data\Mozilla\Firefox\Profiles\*.default") DO COPY "\\Network Path\prefs.js" "%%a\"


Report •

#2
April 2, 2009 at 22:40:11
As you indicate, the dir name is berserk. I don't have a network to try it with but something like the script below should help to discover the dir name.

===================================
dir /s/b/a-d "C:\Documents and Settings\prefs.js"


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#3
April 8, 2009 at 10:13:29
Thanks I got it working by just using cd "C:\Documents
and Settings\%USERNAME%\Application
Data\Mozilla\Firefox\Profiles\*.default\" to get into the
directory and then just copy "\\Network Path\prefs.js" ".\" but
thanks for both responses I think they both would have
worked as well.

Report •

Related Solutions

#4
April 8, 2009 at 11:31:37
That's pretty slick. I didn't know a pushd would take a wildcard.


=====================================
If at first you don't succeed, you're about average.

M2


Report •


Ask Question