bat script

We need to import a certificate in mozilla firefox databse for all users ( 500).
I am trying to do this with logon script,need asistance for doing it with bat or vbs .

file location :  \\domain\netlogon\cert8.db
destitation : %APPDATA%\mozilla\firefox\profiles\&&&&&&(random)default\

Appreciate some short and easey method.

thanks
auk_expertsAsked:
Who is Participating?
 
oBdACommented:
This version only copies if there's a default folder:
@echo off
setlocal
set TargetFolder=%APPDATA%\mozilla\firefox\profiles
set File=%LogonServer%\netlogon\cert8.db
if exist "%TargetFolder%\*.default" (
  for /d %%a in ("%TargetFolder%\*.default") do copy "%File%" "%%~a"
)

Open in new window

You mean the location of the "template" cert8.db when creating a new profile? I'd have guessed somewhere in the main program folder, but I don't know a lot about Firefox, using mostly Opera, sorry ...
0
 
auk_expertsAuthor Commented:
It should be usable through logon script method or GPO
0
 
oBdACommented:
Try this:
@echo off
setlocal
set TargetFolder=%APPDATA%\mozilla\firefox\profiles
set File=%LogonServer%\netlogon\cert8.db
for /d %%a in ("%TargetFolder%\*.default") do copy "%File%" "%%~a"

Open in new window

0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
auk_expertsAuthor Commented:
Thanks , it looks to be working fine. I need to put some condition that if the target folder is not available it should end without error.

and do you know the location of default location of cert8.db for firefox.

0
 
auk_expertsAuthor Commented:
Thanks , will test it and try to find teh template of cert8.db.
Once i do i will close it with your solution.

0
 
kev21111Commented:
Here is the easiest and safest way to do this. We have over 200,000 machines with Firefox but want to keep the IE certificates synced with Firefox.

Create new folder where admin rights are not needed, ie. C:\profiles or wherever your OS teams says you can create a folder

Make sure you have imported the certificates from IE or where ever you want to import them from. You may also have to hit individual site just to get them in your cert8.db

Copy the cert8.db from %appdata%\Roaming\Mozilla\Firefox to the new folder C:\profiles

Modify the Firefox startup to look like this "C:\Program Files\Mozilla Firefox\firefox.exe" -profile "c:\profiles"

When Firefox is launched, it will now use the cert8.db you copied earlier.
This is effective, safe and works!
Good Luck
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.