Leider habe ich hier keine Funktion finden können, mit der ich beim Einlegen der CD die CD benennen kann.
Derzeit wird die CD automatisch mit dem Datum und der Uhrzeit benannt, was ich gerne ändern würde.
Weiss hier jemand Rat?
Function Brenne_Ordner_auf_CD_DVD()
Dim Index ' Index to recording drive.
Dim Recorder ' Recorder object
Dim Path ' Directory of files to burn
Dim Stream ' Data stream for burning device
Index = 0 ' First and only drive on the system
Path = "Z:\Test" ' Files to transfer to disc
' Create a DiscMaster2 object to connect to optical drives.
Dim g_DiscMaster
Set g_DiscMaster = CreateObject("IMAPI2.MsftDiscMaster2")
' Create a DiscRecorder object for the specified burning device.
Dim uniqueId
Set Recorder = CreateObject("IMAPI2.MsftDiscRecorder2")
uniqueId = g_DiscMaster.Item(Index)
Recorder.InitializeDiscRecorder (uniqueId)
' Create an image stream for a specified directory.
Dim FSI ' Disc file system
Dim Dir ' Root directory of the disc file system
Dim dataWriter
' Create a new file system image and retrieve root directory
Set FSI = CreateObject("IMAPI2FS.MsftFileSystemImage")
Set Dir = FSI.Root
'Create the new disc format and set the recorder
Set dataWriter = CreateObject("IMAPI2.MsftDiscFormat2Data")
dataWriter.Recorder = Recorder
dataWriter.ClientName = "IMAPIv2 TEST"
FSI.ChooseImageDefaults (Recorder)
' Add the directory and its contents to the file system
Dir.AddTree Path, False
' Create an image from the file system
Dim result
Set result = FSI.CreateResultImage()
' Stream = result.ImageStream
' Write stream to disc using the specified recorder.
MsgBox "Schreibe auf CD / DVD"
' dataWriter.Write (Stream)
dataWriter.Write (result.ImageStream)
MsgBox "----- Schreibvorgang beendet -----"
End Function