Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch File to Update if File Change
Name: howser99 Date: September 4, 2008 at 15:19:03 Pacific OS: XP CPU/Ram: Core 2
Comment:
Hi All,
Im looking for a way to check if a file has changed, and if so, copy it to a new direftory (sought of like a rudimentry program update). Any help would be more than appeciatred!
Name: Judago Date: September 4, 2008 at 22:10:32 Pacific
Reply:
Does the directory your copying it to have a version of the file?
If so you could probably use a batch file, something to the effect of..
fc x:\destination\existingversion.ext x:\update\newverion.ext>nul if %errorlevel%==1 (copy x:\update\newverion.ext x:\destination\existingversion.ext) else goto otherstuff echo.y :otherstuff
This would compare the files and if they are different the old version would be overwritten with the new version.
If you don't have another file to compare against then you might have to go down the slightly more tedious route of using dates. Obviously You will need something to find if the file has changed, a date an old version.....something?
0
Response Number 2
Name: howser99 Date: September 4, 2008 at 23:43:39 Pacific
Reply:
Thanks for that,
What I think Ill do is create two files that are the same, and when I have a update Ill just replace that file. Problem solved!
Thanks for the help.
0
Response Number 3
Name: Mechanix2Go Date: September 5, 2008 at 03:12:28 Pacific
Reply:
more simply:
xcopy d:\src\my.txt x:\files\ /d
===================================== If at first you don't succeed, you're about average.
Summary: I have a ton of pc's that that I need to remove the C:\documents and settings\userprofiles\Start Menu\Programs\Winzip\ files from that directory. I also have a text file that has all the pc names ...
Summary: Hi, I have created a batch files to search for files from an external list.txt. But now I want to generate a list.txt from all the files that are in a directory and subdirectories but without the path...
Summary: hmmm well I don't know what happened but I can't find you in my chat window Reno :( ... so if you are still on here, please post any solutions you might find if you can. I can't seem to get this bat...