How to move files in C drive using MoveFileEx APi

Posted by rajivpradeep on Stack Overflow See other posts from Stack Overflow or by rajivpradeep
Published on 2010-06-07T09:53:27Z Indexed on 2010/06/07 10:02 UTC
Read the original article Hit count: 229

Filed under:

Hi, when i use MoveFileEx to move files in C drive, but i am getting the ERROR that ACCESS DENIED. Any solutions

int i ; DWORD dw ; String^ Source = "C:\Folder\Program\test.exe" ; String^ Destination = "C:\test.exe"; // move to program Files Folder

    pin_ptr<const wchar_t> WSource = PtrToStringChars(Source);
  pin_ptr<const wchar_t> WDestination = PtrToStringChars(Destination);

i = MoveFileEx( WSource, WDestination ,MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED ) ; dw = GetLastError() ;

© Stack Overflow or respective owner

Related posts about vc++