Solved

MoveFileEx fails under WIN NT 4 WorkStation

Posted on 1998-04-19
6
233 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
[X]
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
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

687 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