CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Problem in using WIN32 API "CopyFile"

    Dear all,

    I am trying to use WIN32 API "CopyFile" to copy a file from a remote machine to local.

    dest = "\\\\desk\\data\\mydata\\test\\1.txt";
    bRet = CopyFile(src, dest, false);

    But, this always fails. GetLastError() returns 3. It looks like "The system cannot find the path specified."

    If I map the shared folder as a network drive like \\desk\data\mydata\test\ -> X:\, the following code will work.

    dest = "X:\\1.txt";
    bRet = CopyFile(src, dest, false);

    Could anybody please give me a little hint? Thanks!
    Edit/Delete Message

  2. #2
    Join Date
    Nov 2008
    Location
    india
    Posts
    53

    Re: Problem in using WIN32 API "CopyFile"

    u could use the path like
    dest = "\\\\desk\\driveletter$\\data\\mydata\\test\\1.txt";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured