Re: Script to merge file to wildcarded subfolder
- From: "Pegasus \(MVP\)" <I.can@xxxxxxxxxx>
- Date: Thu, 28 Aug 2008 18:38:30 +0200
"golderm" <golderm@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A81BE8F8-E980-4D42-9F33-B172B31478AC@xxxxxxxxxxxxxxxx
Hi,
Sorry its hard to explain, at the moment I have this:
copy /a
"C:\Docume~1\mgolder\Applic~1\Mozilla\Firefox\Profiles\hv2nrwpn.default\prefs.js"
+ /a "\\server\data\ext.txt"
"C:\Docume~1\mgolder\Applic~1\Mozilla\Firefox\Profiles\hv2nrwpn.default\prefs.js"
/a
so that merges the text from prefs.js and ext.txt into prefs.js all ok,
however I have a problem in that there is more than one user ('mgolder' in
the example) and Firefox seems to have a random folder for each user under
the profile directory ('hv2nrwpn.default' in the example) so i need
wildcards
for these folders or some sort of command that applies to all folders in
'Docume~1\' and 'Profiles\'
Is that clearer/possible?
Yes, it is both clearer and possible. You can use this batch file:
@echo off
for /F "delims=" %%a in ('dir /a-d /s /b "c:\Documents and
Settings\prefs.js" ^| find /i "firefox"') do echo type
"\\server\data\ext.txt" $$ "%%a"
Note this:
- This is a two-line batch file. The second line starts with "for" and ends
with
'"%%a"'. You must unwrap it if your newsreader wraps it.
- Run it from a Command Prompt to test it.
- To activate it, remove the word "echo" in line 2 and replace "$$" with
">>".
- When you want to append some text to an existing text file, you use
the command
type SourceFile >> TargetFile
The "copy File1 + File2" command is both wasteful and unnecessary.
- You should avoid using short file names such as "Docume~1" as this
can cause problems. The proper name is "C:\Documents and Settings".
- Note the warning on top of the prefs.js file:
/* Do not edit this file.
*
* If you make changes to this file while the application is running,
* the changes will be overwritten when the application exits.
*
* To make a manual change to preferences, you can visit the URL
about:config
* For more information, see
http://www.mozilla.org/unix/customizing.html#prefs
*/
.
- Follow-Ups:
- Re: Script to merge file to wildcarded subfolder
- From: golderm
- Re: Script to merge file to wildcarded subfolder
- References:
- Script to merge file to wildcarded subfolder
- From: golderm
- Re: Script to merge file to wildcarded subfolder
- From: Pegasus \(MVP\)
- Re: Script to merge file to wildcarded subfolder
- From: golderm
- Script to merge file to wildcarded subfolder
- Prev by Date: Re: Script to merge file to wildcarded subfolder
- Next by Date: Re: Script to merge file to wildcarded subfolder
- Previous by thread: Re: Script to merge file to wildcarded subfolder
- Next by thread: Re: Script to merge file to wildcarded subfolder
- Index(es):
Relevant Pages
|
Loading