Aric B. Lambert <a...@erc.msstate.edu> wrote in article
<710184$b6m$1...@nntp.msstate.edu>...
Best Wishes
--
--------------------------------------------------------------------
| EMail ro...@ttelmah.demon.co.uk http://www.ttelmah.demon.co.uk/ |
| A beard! A beard! cried Fly Nicholas.'By God, that's a good one!'|
| (Chaucer) |
And this is not possible when the .dll is in use by windows...
Another way of doing it, is to put the new <file>.dll in the directory
as <file>.tmp, and have it renamed to .dll during startup. There is a
way to set this in the registry - not sure how to do it though :-/
Frode G.
The trick's rather nasty and I would suggest you really take all
security measures. The command shell of NT seems to happily ignore file
locks. so, you can use the 'copy' command to replace the dll in question
with your machine running. Afterwards' I'd suggest a reboot. As I said,
this trick is nasty and might result in damage so handle with care!
Henning
--
"I have no idea what's going on here, but it's quite entertaining..."
-- Jason Willoughby on r.h.o.d
E-Mail will be posted as I see fit.
If you can't locate the program that is using the file then you do this.
Rename the old file.
Copy the new file.
Reboot.
Otherwise just close the program that's using the file.
cheers.
> Aric B. Lambert
> NSF Engineering Research Center
> Mississippi State University
> P O Box 9627
> Mississippi, MS 39762
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
******* Put this in a module *******
Option Explicit
Declare Function MoveFileEx Lib "kernel32" Alias "MoveFileExA" (ByVal
lpExistingFileName As String, ByVal lpNewFileName As String, ByVal dwFlags
As Long) As Long
Public Const MOVEFILE_DELAY_UNTIL_REBOOT = &H4
Public Const MOVEFILE_REPLACE_EXISTING = &H1
******* Create a function that creates a move-on-reboot *******
MoveFileEx "currentfilename", "newfilename", MOVEFILE_DELAY_UNTIL_REBOOT +
MOVEFILE_REPLACE_EXISTING
----------------
I used this function in an install program I wrote with VB for NT. This
will not work for Windows 95/98! You have to use the wininit.ini for
windows 95, but it works similarly.
Aric B. Lambert wrote in message <710184$b6m$1...@nntp.msstate.edu>...
>
>How can I copy a dll file to the system32 directory if the file is being
>used by Windows?
>--
You can also replace inuse files by editing:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager and ammend
or Add Value name
PendingFileRenameOperations, a type REG_MULTI_SZ value. Each rename uses two
lines
Line 1 contains: \??\<Drive:>\<SourcePath>\SourceFileName.Extension\0
Line 2 contains:
\??\<Drive:>\<DestinationPath>\DestinationFileName.Extension\0
If you had additional files, they would be line 3 and 4, 5 and 6, etc....
At the next boot, the <Drive:>\<SourcePath>\SourceFileName.Extension
is moved to the <Drive:>\<DestinationPath>\DestinationFileName.Extension
and the PendingFileRenameOperations value name is deleted.
Required Disclaimer:
The opinions expressed herein are my own and are NOT those of my employer.
--
When I die, I want to go peacefully,
In my sleep, like my grandfather.
Not screaming,
like the passagners in his car!
wsi...@netscape.net