Solved

MoveFileEx fails under WIN NT 4 WorkStation

Posted on 1998-04-19
6
229 Views
Last Modified: 2013-12-03
Under win nt 4 workstation (ver 4.00.1381), I use my own installer for a very specific task of replacing a dll that is in use.

If I call MoveFileEx(Src, Dst, MOVEFILE_DELAY_UNTIL_REBOOT), nothing happends.

I looked up MSDN and the say that it is supposed to create a registry key at
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\Session Manager\PendingFileRenameOperations

But it doesn't.

I put it manually and it didn't make a difference.

Please help.
0
Comment
Question by:ssite
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:ssite
ID: 1298613
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
ID: 1298614
Does the MoveFileEx() call return non-zero indicating an error occured?  If so, did you call GetLastError() to get the error code?  Are the paths you are specifying correct?  If nothing else, can you post your code?
0
 
LVL 1

Author Comment

by:ssite
ID: 1298615
It doesn't return an error.

Am I supposed to use long, or short file names ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:nietod
ID: 1298616
you can always use short names.  To the best of my knowledge, all Windows API functions will also take long names--certainly this one would.  

Can you post the code?
0
 
LVL 3

Accepted Solution

by:
byang earned 20 total points
ID: 1298617
Before your call to actually move the file, delete the original:

MoveFileEx(Dst, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);

This is how it's documented in platform SDK.

You can also try adding the MOVEFILE_REPLACE_EXISTING flag to your code. I never tested if this flag works before the test involves rebooting.


0
 
LVL 1

Author Comment

by:ssite
ID: 1298618
I am away from the office for 24 hours. I will test it when I get back and confirm the answer.
Thanks for now.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now