Solved

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

Posted on 2014-12-03
3
310 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
3 Comments
 
LVL 23

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 83

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

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Question has a verified solution.

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

Suggested Solutions

Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now