Solved

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

751 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