overwrite system dll's

Posted on 2001-07-10
Last Modified: 2013-12-03
I'm installing a software and I need to update some dll's in the system folder.
some of these dll's are always locked by the system, and the installer (which is a tcl script) fails on the copy.

How do I do this, how to overwrite the dll's?
Question by:romanm
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

mxjijo earned 300 total points
ID: 6270409

There are 2 scenarios. I hope you can do Win32 stuff from TCL

1) You need to replace the DLL's in use.
2) You need to replace the System DLL's.

In the first case, use MoveFileEx() with MOVEFILE_DELAY_UNTIL_REBOOT flag. On reboot the system will replace the Old file with the new file.

The second case is a little more complicated. Windows protects all its system files with WFP (Windows File Protection) - Its sux!! When you try replace/modify any of these protected files, Windows will simply replace it with the Original installed copy from its cache. But, the good news is, there is an undocumented Reg entry that the experts found out, which can disable WFP. I forgot that regKey, You need to look up in the newsgroups for MoveFileEx()

LVL 20

Expert Comment

ID: 6270580
mxjijo is right. However, MoveFileEx with DelayUntilReboot works only in winNT. In win9x you have to edit the file "C:\Windows\WinInit.ini" to replace files that are in use during the next reboot. The WFP problem in winME remains the same...

Regards, Madshi.
LVL 86

Expert Comment

ID: 6271248
MS has two KB articles that describe this issue in detail: ('HOWTO: Move Files That Are Currently in Use' - W2k/NT and Win9x)

An additional methid for Win9x is described in ('How to Automatically Replace Files In Use by Windows 95')

An additional method for W2k/NT can be found at ('How to Replace Files In Use at Windows NT Restart')

Expert Comment

ID: 6271794
Every dll/ttf/exe/vxd that is shipped with Windows 98SE/2000/ME/XP is protected with either SFP, SFC, or WFP.

Getting around SFP in Windows 98SE isn't too hard. Getting around WFP in Windows 2000 (with no service packs installed) isn't too hard either with a little dissassembly of core system files.  After SP1 is installed there really isn't any easy way to disable WFP. And Windows XP is looking darn near impossible to disable.

Unless you get a digital signature on your CAB file from Microsoft by testing it in their laboratories, you're going to have to disable the WFP.

Is this the type of system file you are talking about? Or are you referring to simply an in-use file?

*note: SFC=SystemFileChecker, WFP=WindowsFileProtection, SFP=SystemFileProtection

Author Comment

ID: 6276955
I've used the MoveFileEx solution.
I still prefer to do it using the registery but a deadline is a deadline.
tnx mxjijo

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question