Batch File-overwrite existing file newer available

  Sir Radfordin 10:02 26 Aug 04
Locked

Have a situation where a local copy of a file is kept on several PCs. There is a master copy on a server which is changed and updated occasionaly. When the master copy is updated it has to be copied over to the local PCs.

What I would like is a batch file (or something that does the same thing) which would check the last modified date on the master file and if newer than the local file download and replace the local copy before loading.

Any ideas on how to do this?

  Sir Radfordin 15:31 26 Aug 04

No ideas?

  woodchip 16:01 26 Aug 04

I know what you want to do but is this a good idea. As something may get changed and mess the original doc up, so you have nothing to fall back to.

  Taff36 16:18 26 Aug 04

It works in our company with report files, templates and logos. My IT specialist is in tomorrow so I`ll ask him how complicated it is cos` he writes them for me.

  Zak 18:04 26 Aug 04

Here is a batch file, copy to notepad and then save aaas .bat file:


@ECHO OFF


ECHO Backup of Drive D: (Hard Drive) folder "My DOCUMENTS" (in DOS: MYDOCU~1) to Drive H: (CD-Writer


ECHO (on a UDF-formatted CD-RW)) same folder. All files (*.*) will be copied.


ECHO The files on the target-drive will be overwritten without questioning (Parameter /Y)


ECHO The file attribute 'Archive' will be reset, so that the same file will be only backuped when it was


ECHO changed (Parameter /M) or the archive bit was set manually.


ECHO All (Sub-)folders will be copied (Parameter /S), even if they are empty (Parameter /E)


ECHO .


@ECHO ON


E:


CD\MYDOCU~1


XCOPY32 E:\MYDOCU~1\*.* L:\MYDOCU~1\*.* /Y/M/S/E
CD\MYDOCU~1


XCOPY32 E:\MYDOWN~1\*.* L:\MYDOWN~1\*.* /Y/M/S/E


REM CD\MYDOCU~1


REM XCOPY32 E:\FAVORI~1\*.* L:\FAVORI~1\*.* /Y/M/S/E

  Zak 18:07 26 Aug 04

I have used double spaces between lines so that it posted correctly. Basically you can follow format and use which folders you want to copy and set up appropriate target folders. You need to always use the DOS folder name.

Please post if any of this is unclear.

This thread is now locked and can not be replied to.

Qualcomm Snapdragon 835 benchmarks: Antutu, Geekbench 4, GFXBench and PCMark results

1995-2015: How technology has changed the world in 20 years

This stop-frame animation tells a moving story of domestic violence for Refuge

New iPad 2017 preview: Apple's affordable but underspecced new iPad may appeal to the education…