-
August 15th, 2003, 08:12 PM
#1
Copy a file from a remote computer
Hi Gurus!
Please help me for this problem.
I want to copy a file (C:\sharedir\sample.txt) from a remote computer (online).
IP : aaa.bbb.ccc.ddd
Computer name : pcname
I used this command of API in MFC
BOOL bCopyOK=::CopyFile("\\\\aaa.bbb.ccc.ddd\\c\\sharedir\\sample.txt","C:\\sample.txt",FALSE);
or
BOOL bCopyOK=::CopyFile("\\\\pcname\\c\\sharedir\\sample.txt","C:\\sample.txt",FALSE);
but I can not copy this file.
What wrong? Please help me! Thankssssss!
I can access that sharedir .
Last edited by never_finalboss; August 16th, 2003 at 03:00 AM.
-
August 16th, 2003, 12:46 AM
#2
I don't know a copy API that copies a file. Try CopyFile API instead. Also, make sure that you can access the share in the remote PC.
Hope it will help you
-
August 16th, 2003, 02:15 AM
#3
Thank to rxbagain, sorry about that problem, I editted it. Thank again!
-
August 16th, 2003, 03:14 AM
#4
Is the drice c shared too? If only the sharedir is shared in the remote pc, remove the "\\c" in the filename. Use the filename with the hierachy as you see with the network browser.
"\\\\pcname\\sharedir\\sample.txt".
Hope it will help you
-
August 17th, 2003, 06:40 AM
#5
The driver C is shared too, I try copy this file using Dos Prompt like this:
C:\copy\\aaa.bbb.ccc.ddd\\c\\sharedir\\sample.txt c:\
This command is success, but when I can not use MFC to copy that file. Please help me
-
August 17th, 2003, 08:50 AM
#6
Well...as usual...check the error code. If 'CopyFile()' fails, you can get the error code by a call to 'GetLastError()'...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|