Solved

MoveFileEx fails under WIN NT 4 WorkStation

Posted on 1998-04-19
6
230 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

809 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