I have a small app which try to move files.
Here is the min code:
#include <windows.h>
int main()
{
MoveFile("C:\\test.txt", "C:\\folder\\test.txt");
// Here I use GetLastError() to get last error code witch is 2 and I can't find what mean;
return 0;
}
IMPORTANT: This error appear on windows 7 but on win XP works, the file is moved!
You can find all the error codes on MSDN or in your header files.
2 is
ERROR_FILE_NOT_FOUNDwhich means your source file couldn’t be found when you were trying this on Windows 7. Make sure you had the correct relative/absolute path in there.