Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy files in C++

Posted on 2000-03-08
2
Medium Priority
?
452 Views
Last Modified: 2012-06-27
How do I copy a file from a certain location on one harddisk to another?
I would like to have the answer with both a way to copy from drive c: to drive d: and a way to copy from drive c: to an UNC-path, for example \\ns\c$
or \\ns\test
0
Comment
Question by:TFreak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 210 total points
ID: 2597975
I assume this is for windows right?

Then use the CopyFile() windows api function.

example follows.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2597994
CopyFile("C:\\TEST.TXT","D:\\TEMPDIR\\TEST.TXT",TRUE);

CopyFile("\\ns\c$","C:\\WINDOWS\C$",TRUE);

Let me know if you have any questions.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question