Click here to Skip to main content
13,149,756 members (57,940 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have an application that runs an inspection system and then moves & renames the resulting image files to a data folder. I used FindFirstFile(), MoveFile(), and FindNextFile() renaming the file on the move. Now I need to put the image files in a folder on a mapped drive. CreateDirectory() works great at building the directory structure on the mapped drive but ( as I am sure you all know!) MoveFile() fails. Is this a path definition issue? Do I need to specify the mapped drive as a URL? Any help will be greatly appreciated!

Ron H. ( In MN where we just got another 7 inches of heavey wet snow on my tulips! Errr!)
Posted 18-Apr-13 22:35pm
pasztorpisti 19-Apr-13 5:23am
We don't know the exact parameters of your utility and my hints may sound obvious and foolish but MoveFile() can move files/dirs only between the directories of the same drive/volume. Between different directories you have to perform a file copy+delete combo. The MoveFile() documentation has some other comments for SMB that may be irrelevant in your case:
Malli_S 19-Apr-13 5:26am
Oops !!! :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The MoveFile will always fail if the destination path is on different volume. Better you copy and then delete the source file manually.

For your reference check this[^].
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The MoveFile will fail on Directory moves I do not think on file move to be a problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170924.2 | Last Updated 6 Jun 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100