Re: Script to merge file to wildcarded subfolder




"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
*/


.



Relevant Pages

  • Success
    ... secure Windows, IIS, IE, Outlook Express ... >different upload and download folders. ... >Third party FTP software, or OpenSSH, or VPN can be used ... >1) Use a "DOS" Command Prompt for the steps below. ...
    (microsoft.public.inetserver.iis.security)
  • Re: system folders not shared?
    ... It is amazing how much can be accomplished at a command line. ... I still could not access XP's system folders. ... files would open across the network but media files would not). ... permissions to block the sharing of certain folders. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Vanishing icons on Desktop and in Recycle Bin
    ... Use the command prompt ... I couldn't see a SID #. ... Both of those SID # folders should open, ... My INFO2 opens. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: List View: Calculate all sizes Default?
    ... figure out how to use Ian's command (which, above, I incorrectly referred ... This is why my script sends items to the trash rather than immediately ... folders are completely ignored. ... Is there a reason to suspect the restore would _not_ include ...
    (comp.sys.mac.system)
  • Help With [seemingly] Simple Problem
    ... I have a FreeBSD7 server box in my garage that serves the computers on my ... The box has basic non-gui install of FreeBSD7 and I access it through WinSCP ... another folder and there are same files in both folders (one I am ... Friend of mine suggested this command through ...
    (freebsd-questions)

Loading