Solved

batch file to find first directory in relative path and add file

Posted on 2014-12-03
3
328 Views
Last Modified: 2014-12-03
Can someone help me with a bat file to do the following.

Firefox makes randomized default profile directories in app data.
I need to add a certificate file to that directory on over 120 computers.

The path is something like this:
"c:\documents and settings\manager\application data\Mozilla\profiles\"
then it will be like tz3456d.default
and so forth

I need to run a bat to find that directory and copy a certificate.txt file into that directory.  
Thanks!
-tony-
0
Comment
Question by:bbimis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 24

Expert Comment

by:NVIT
ID: 40478726
Is there more than 1 tz?????.default folder in the app folder at any time? If so, how to know which to put cert in?
0
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 40478766
Since this is part of a user profile, you should roll that out using a logon script.
This will copy the certificate into all profile folders for the user:
@echo off
setlocal
set Certificate=\\SomeServer\SomeShare\certificate.txt
for /d %%a in ("%AppData%\Mozilla\Firefox\Profiles\*.default") do (
	copy "%Certificate%" "%%a"
)

Open in new window

0
 

Author Closing Comment

by:bbimis
ID: 40478810
thank you so much
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question