File copy/replace utility

T

Thore

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
 
A

Adam Piggott

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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?

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)

iD8DBQFDMVjM7uRVdtPsXDkRAtqOAJ4jQWsHUu7enBKeE6CcWw64AESpcgCePg8G
N3s2x3VNl15x4OIKxHV2+CA=
=SblX
-----END PGP SIGNATURE-----
 
T

Thore

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.

Correct... thats right..
Please, please take a backup first! I am fairly sure this doesn't work with
Windows 9x.

Tried that, but no success..:)
Have to wait until I come home tonight to test it on XP..
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"

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..)
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!

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
 
B

Bjorn Simonsen

Thore wrote in said:
(didn't know there was much differences in XP - cmd and win98 -
command-prompt, though..)

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/.../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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

IrfanView 3.98 13
4-up print 7
AVG Automatic? 3
Wanted: CD Menu program 3
IrfanView 3.98 - batch/add all ? 10
CCleaner 12
Wanted: WS_FTP95 LE-like 16
MS Publisher alternative? 16

Top