Windows Vista系统内置了CD/DVD光盘刻录功能,当然,这个功能在Windows Media Player里面早已提供,但它现在和文件系统已经集成,功能上算不上强大,但使用上很傻瓜。对于普通用户的简单刻录需求,可以说简单够用。
有两个途径,一是右键点击要刻录的文件或者文件夹,选择Send To,再选择DVD RW Drive (E:),就可以了(机器不同则菜单上有细微差别,我的是DELL 640m)。
或者在资源管理器里面直接打开DVD RW Drive,此时在工具栏上会出现一些按钮,比如Burn to disc和Erase this disc。这时候可以直接CTRL+A选中所有文件并删除(如果你不想续刻),把要刻录的文件或文件夹直接拖进去... 就像操作一个Flash Drive一样(有了这个功能还买什么DVD-RAM刻录机?)。
实在是太简单了,不想详细描述。但下面的问题是光盘镜像文件怎么刻录?我没找到(谁找到了请在下面留言)。问题不大,以前记得Windows Server 2003的一个Resource Kit里面有这个功能,下载地址请点这里。这是个12MB的一个自解压包,不过如果你只关心刻录工具,那大部分都是没用的... 下载之后用7-Zip(或者WinZIP、WinRAR等)打开,在rktools.msi里面看到cdburn.exe和dvdburn.exe这两个文件。把它们解压缩到C:\DVRW(或者其它路径)。
然后就可以刻录镜像文件了,比如我打算把刚下载的en_office_business_contact_manager_2007_X13-05848.iso刻录到我的一张DVDRW光盘里面,那么打开命令行界面输入:
C:\DVRW>dvdburn E: D:\Software\en_office_business_contact_manager_2007_X13-05848.iso
如果光盘里已经有东西则自动帮你擦除光盘(假如是RW)。
这两个工具的用法如下:
C:\DVRW>cdburn -help
Usage:
cdburn <drive> -erase [image [options]]
cdburn <drive> image [options]
Options:
-erase Erases the disk before burning (valid for R/W only)
-sao Writes the image out in "session at once", or cue sheet, mode (default is "track at once")
-speed Speed of burn, or 'max' for maximum speed
-imagehaspostgap Use if your image already contains a 150 sector postgap
The [image] must be provided unless the -erase flag is set.
If both an image and -erase are provided, the media will be erased prior to burning the image to the disc.
C:\DVRW>dvdburn -help
Usage: dvdburn <drive> <image> [/Erase]
最后,除了给普通用户提供的刻录功能,系统还公开了刻录API — 微软一贯风格。这个不是Windows Vista的新功能了,事实上它是Windows Media Player API的一部分。参考:Windows Media Player 11 SDK IWMPCdromBurn Interface。如果没有记错的话,WMP 9就已经有这个接口了。
----- Update on 7/30/2007
今天翻UDF文件格式的资料的时候才发现IMAPI才是用来管光盘刻录的,WMP的那个只是专门用来把mp3刻成CD。
看这个:http://msdn2.microsoft.com/en-us/library/aa364817.aspx
里头有个例子:
' This script burns data files to disc in a single session
' using files from a single directory tree.
' Copyright (C) Microsoft Corp. 2006
Option Explicit
' *** CD/DVD disc file system types
Const FsiFileSystemISO9660 = 1
Const FsiFileSystemJoliet = 2
Const FsiFileSystemUDF102 = 4
WScript.Quit(Main)
Function Main
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 = 1 ' Second drive on the system
Path = "g:\BurnDir" ' Files to transfer to disc
' Create a DiscMaster2 object to connect to optical drives.
Dim g_DiscMaster
Set g_DiscMaster = WScript.CreateObject("IMAPI2.MsftDiscMaster2")
' Create a DiscRecorder object for the specified burning device.
Dim uniqueId
set recorder = WScript.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.CFileSystemImage")
Set Dir = FSI.Root
'Create the new disc format and set the recorder
Set dataWriter = CreateObject ("IMAPI2.MsftDiscFormat2Data")
dataWriter.recorder = Recorder
FSI.FreeMediaBlocks = datawriter.FreeSectorsOnMedia
FSI.FileSystemsToCreate = FsiFileSystemISO9660
' 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.
WScript.Echo "Writing content to disc..."
dataWriter.write(Stream)
WScript.Echo "----- Finished writing content -----"
Main = 0
End Function你甚至可以用这套API制作ISO镜像文件。同时支持ISO9660、Joliet和UDF。
打印 | 张贴于 2006-12-11 03:05:00 | Tag:Patterns and Practice





留言反馈
如找到,希望发给我:suzhihui@yahoo.cn,thanks