Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDName

Status
Not open for further replies.

XerxesTheMighty

Programmer
Jun 15, 2003
72
US
I'm creating a special program for a CD.
1. Drive Letter: How to find the specific drive for the CD (i.e. search the drive labels? for example if I have quake in the cd drive I'd search the labels for QUAKE3 or whatever, then obtain the drive letter somehow (cause if you have multiple drives....))
2.How to copy a file from the CD to a folder.

--------------
"I am a master of Suggestionism and Imperfectionism, bugs and errors are mine!"-this is an original statement by ME:
Xerxes Dynatos
 
Just a look in MSDN:

// crt_getdrives.c
#include <windows.h>
#include <direct.h>
#include <stdio.h>
#include <tchar.h>

TCHAR g_szDrvMsg[] = _T(&quot;\tA:\n&quot;);

int main(int argc, char* argv[]) {
ULONG uDriveMask = _getdrives();

if (uDriveMask == 0)
printf(&quot;_getdrives() failed with failure code: %d\n&quot;, GetLastError());
else {
printf(&quot;The following logical drives are being used:\n&quot;);

while (uDriveMask) {
if (uDriveMask & 1)
printf(g_szDrvMsg);

++g_szDrvMsg[1];
uDriveMask >>= 1;
}
}


Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top