RewriteFiles Utility | CodeGuru

RewriteFiles Utility

The Problem This small commandline utility will solve a problem often found when moving Visual C++ projects between computers. Often I need to take MSVC5 projects with me between different computers. But sometimes, when a project has been moved from one computer to another, strange thing will happen , when you try to compile it.When […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 6, 1998
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

The Problem


This small commandline utility will solve a problem often
found when moving Visual C++ projects between computers.


Often I need to take MSVC5 projects with me between
different computers. But sometimes, when a project has been moved from one
computer to another, strange thing will happen , when you try to compile it.
When the program has been compiled, and you try to execute
it  – or for some reasons hit that ol’ Build-button, the whole project will
recompile, like every file has been changed. This will happen every time you try
to compile, even if you do not change a single characte in your sourcefiles.


The problem has something to do with the filedates, that
are improperly changed in some way.


The Solution
I have written a
small commandline utility, that solves the problem. The only thing this program
will do is to open all the original files, move them to another folder, and
rewrite them in their original location.


I have not provided the sourcecode for this project, for
two reasons:


  • The project is not a typical MFC program, eventhough
    classes and functions from MFC was used.
  • The sourcecode is really messy, and uncommented, and
    many of the functions are in small utillity files, I have collected for
    everyday tasks.

If, however, anybody should be interested in the
sourcecode, please mail me, and I will send you a copy.


Usage
Rewritefiles.exe is
extremely easy to use:


Fire up a DOS-Window or a NT-commandline, go to the
directory with the project giving the problems, and write

Rewritefiles *.* c:myprojectsproject
Rewritefiles *.* c:myprojectsprojectres

Assuming, that your project is located in
c:myprojectsproject, and you have some resource files in the subdirectory
"res".


There are some other commandline options, that will be
shown if you just write RewriteFiles on the commandline, without any
parameters.


Download
File – 83KB

Date Posted: 05/21/98

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.