Solved

MoveFileEx fails under WIN NT 4 WorkStation

Posted on 1998-04-19
6
232 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Suggested Solutions

Title # Comments Views Activity
Best book to learn C++ 4 96
WPF issue with Trigger 2 147
Visual Studio: built-in keystroke automation 2 88
Need an intro to -- .Net SQL Authorization Manager 7 101
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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