- File copy/replace utility
- Posted by Thore on September 21st, 2005
Hi...
I have a textfile named main.css in a library e.g. c:\new\main.css
On another disk I have d:\homepage\lib1...lib2...lib3... and so on.
In each of these libraries there is a main.css.
I want to replace all the 'main.css'ses in d:\homepage with the one in
c:\new\main.css.
OK, I can just do it manually, but there is about 100 lib's, and the
main.css is going over some modifications all the time..
So if there was a nice little freeware prg. that would do it for me...
DOS, Win9x or XP...doesn't matter. Anyone?
And.... is there a utility that can do the same thing on my web-hotel?
--
Venlig hilsen / Best regards
Thore Sorensen - DK2700 Brønshøj / DK2620 Albertslund
(Erstat evt. AT med @ i mailadressen hvis du mailer direkte)
Min hobbyside: www.RacePhoto.dk
- Posted by Adam Piggott on September 21st, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thore wrote:
So you have the following directories, for example:
d:\homepage\lib1
d:\homepage\lib2
d:\homepage\lib3
Each with a main.css file in them that you would like to overwrite with a
specific main.css.
Please, please take a backup first! I am fairly sure this doesn't work with
Windows 9x.
Assuming that there are no other main.css files in d:\homepage or *any*
subdirectories that you don't want overwritten:
Start->Run->cmd
cd /d d:\homepage
for /R %I in (main.css) do copy /y "c:\new\main.css" "%~fI"
Which means:
for <recurse subdirectories> <variable> in <files that match main.css> do
copy <overwrite> <master css file> <full pathname to each matching filename
variable>
If in a batch file, use two %'s for each %.
Let me know how you get on!
- --
Adam Piggott, Proprietor, Proactive Services (Computing).
http://www.proactiveservices.co.uk/
Please replace dot invalid with dot uk to email me.
Apply personally for PGP public key.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
iD8DBQFDMVjM7uRVdtPsXDkRAtqOAJ4jQWsHUu7enBKeE6CcWw 64AESpcgCePg8G
N3s2x3VNl15x4OIKxHV2+CA=
=SblX
-----END PGP SIGNATURE-----
- Posted by Thore on September 21st, 2005
On Wed, 21 Sep 2005 13:57:49 +0100, Adam Piggott
<usenet@proactiveservices.co.invalid> wrote:
Correct... thats right..
Tried that, but no success..
Have to wait until I come home tonight to test it on XP..
My new *.bat file is like this:
cd d:\homepage
for /R %%I in (main.css) do copy /y "c:\new\main.css" "%%~fI"
.... and the error in win98 is syntax-error, so I will try on XP later
tonight...
(didn't know there was much differences in XP - cmd and win98 -
command-prompt, though..)
Thanks for the very quick repons..
I'll get back...
--
Venlig hilsen / Best regards
Thore Sorensen - DK2700 Brønshøj / DK2620 Albertslund
(Erstat evt. AT med @ i mailadressen hvis du mailer direkte)
Min hobbyside: www.RacePhoto.dk
- Posted by Bjorn Simonsen on September 21st, 2005
Thore wrote in <eho2j19eulhkh6tc8udnl3fcul4nqholct@4ax.com>:
Have a look at:
--------------------------
Information about command and CMD commands
http://www.computerhope.com/cmd.htm
Command vs. Cmd
<http://www.computerhope.com/issues/ch000395.htm>
CMD.EXE or COMMAND.COM
http://www.chami.com/tips/windows/122096W.html
Command vs. Cmd (see comments)
<http://www.hyperorg.com/blogger/mtarchive/001935.html>
Command shell overview
<http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx>
Download:
--------------------------
FAQ collection of Useful NT/2000/XP script tricks and tips by T.Salmi
<ftp://garbo.uwasa.fi/pc/link/tscmd.zip>
FAQ collection of useful batch files and tricks by T.Salmi
<ftp://garbo.uwasa.fi/pc/link/tsbat.zip>
Links to more info at:
--------------------------
T.Salmis links page:
[MS-DOS...WinME batch]
<http://www.uwasa.fi/~ts/http/http2.html#batch>
[NT/2000/XP shell]
http://www.uwasa.fi/~ts/http/http2.html#cmdscript
All the best,
Bjorn Simonsen