Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - Burning Multisession CDs with IMAPI2 in WS...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Burning Multisession CDs with IMAPI2 in WSH
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-11-10

    Table of Contents:
  • Burning Multisession CDs with IMAPI2 in WSH
  • Getting started
  • Building the burn image
  • Adding files and burning the image
  • Final thoughts

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Burning Multisession CDs with IMAPI2 in WSH - Building the burn image


    (Page 3 of 5 )

    In order to begin writing a new session to a disc, you must first check for any existing sessions on the disc to find where they end.  This is so the IMAPI2 control knows where to begin writing the new session on the disc.

    If Not objImageWriter.MediaHeuristicallyBlank Then

    The ImageWriter object provides the MediaHeuristicallyBlank method that returns a Boolean value indicating whether or not there are existing sessions on the disc in the drive.  You can create an If construct around this method to determine what course of action should be taken to create the current session image.  If this value is true, you should import the existing sessions and append to that file system.  If false, this indicates that we are writing the first session and we should create the file system.

       On Error Resume Next

       objFSI.MultisessionInterfaces = objImageWriter.MultisessionInterfaces

       If Err.Number <> 0 Then

           WScript.Echo "Multisession is not supported for this disc"

           WScript.Quit

       End If

       On Error GoTo 0

    If a current session does in fact exist, we can perform a quick check to determine whether or not writing multiple sessions is supported by the current recording device.

       WScript.Echo "Importing data from the previous session..."

       objFSI.ImportFileSystem()

    If at this point, all is well, it means that the disc contains existing sessions and that writing multiple sessions is supported.  We should then import the existing file system and append our new data to that.

    Else

       objFSI.ChooseImageDefaults(objRecorder)

    End If

    If the disc in the drive is blank, we should create a new file system inside of our session image.  The ChooseImageDefaults does this easily by examining the drive and current media and creating a file system accordingly.  In most cases, the default ISO9660 format will be used.

    More Windows Scripting Articles
    More By Nilpo


     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek