Solved

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

Posted on 2014-12-03
3
340 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 85

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

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

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

PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

623 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