473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem Copying File From CD

I am an experienced programmer that is fairly new to C++. I have written a small installation executable that is supposed to copy a set of files from within a directory just on the CD. The problem is that I do not know which drive letter will be used for the CD (EG D:\, E:\ F:\). I have tried copying the file using windows.h and system("COPY .... "); both look for the files in my documents, not on the CD...

Example code:

CopyFile("bin\\install.php", copyfile.c_str(), true);

- OR -

cmd = "COPY /Y \"bin\\install.php\" \"" + htdocsloc + "\\install.php\"";
cout << cmd << endl;
system(cmd.c_str());

When compiled, then the exe put on the cd, it says that the system cannot find the file specified. Can anyone help me with this problem?
Aug 26 '07 #1
3 1616
weaknessforcats
9,208 Expert Mod 8TB
If this is Windows you can call GetCurrentDirectory() and fish the drive letter out of the returned string.
Aug 26 '07 #2
Great, I will give it a try and reply back if it worked. Thank you very much.
Sep 16 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
You can also get drive letter determination for Windows:
GetLogicalDrives.
GetLogicalDriveStrings.
Sep 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
9
by: Zoo Keeper | last post by:
For some reason, the Python preprocessing balks on the "\" line continuation character. Any ideas/thoughts? Is it just that my version of gcc is not supported? I don't "need" numeric in my...
6
by: Club-B42 | last post by:
i've compiled my programm using command "python setup.py py2exe >1" python script works fine, but .exe version fails with =====================================================================...
0
by: Grant Edwards | last post by:
I've got a system where I try to install extensions using /usr/local/bin/python setup.py install But, it fails when it tries to use a non-existant compiler path and specs file. I suspect it's...
2
by: RuiT | last post by:
Hello I want to detect when a new file is added to a existing folder and access it. How can I do this (C#)? Thanks
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.