Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
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…
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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now