Results 1 to 5 of 5

Thread: VB and Writing to CDs

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    30

    Angry

    Hello, I have a file which has to be written to a HP CDRW drive (that has Direct CD so that the D:\ acts as a regular drive). I need to be able to:

    i. check to see if the CDRW is formatted
    ii. ** erase the current data on the CDRW media **
    iii. copy the file to the CDRW media

    I really need help with these three tasks, especcially number two. Please help, thanks.

    Brandr
    [email protected]

  2. #2
    Guest
    you can probably shell the dos command DelTree, or you can shell FDisk or something.
    and I think you just copy files like you normally would,
    but I dont know the answer to #1

  3. #3
    Lively Member
    Join Date
    Jul 2000
    Posts
    94
    denniswrenn - No you actually can't shell to dos to do this. CDRW does not act as normal media. You need a third party program to treat it like a disk (ie Direct CD).

    Brandr - I've seen code for C++ to write CDs, but never VB code. I don't know if it is possible without an additional dll or control

  4. #4
    New Member
    Join Date
    Sep 2001
    Location
    Virginia
    Posts
    1

    Talking

    Here's something that might get you started.

    In your project, make a reference to the 'Microsoft Scripting Library' (SCRRUN.DLL).

    There are Win32 API calls for doing this, but this is much easier.


    Use the Following code snipets:

    (Declaration section)
    Private oFSO As FileSystemObject
    Private oDrive As Scripting.Drive

    (Function)

    Function GetCDInfo(strDrive as string) as String
    Set oFSO = New FileSystemObject
    Set oDrive = oFSO.GetDrive(strDriveLetter) '
    GetCDInfo=oDrive.FileSystem
    Set oDrive=nothing
    Set oFSO=nothing
    End Function


    It will return the following strings for CDs:

    "CDBLANK" unformatted CDR or CDRW
    "CDFS" - normal data/music CD
    "CDUDF" - formatted, unclosed CDR
    "CDUDFRW" - CDRW formatted

    Not sure how to programatically format an unformatted CDR(W),
    But, once formated, you can use normal VB disk I/O methods.
    Jeffery Crooks
    Virginia Beach, VA
    [email protected]

  5. #5
    Megatron
    Guest
    Check and see if your writer came with any OCX controls, or DLLs.

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