Sample: Copy files and invoking CD Writing in XP 
Author Message
 Sample: Copy files and invoking CD Writing in XP

Option Explicit

Dim MyCDRW, MySource, MyCDNAME, MyDateCode, MyTarget

Dim oShell, oApp, oFolder, vbShort

' Change these three settings to suit your system

MyCDRW = "E:\"

MySource = "C:\Documents and Settings\John\My Documents" 'Folder name only

MyCDName = "MyDocs" 'Keep this short (6 Chars) as we add a YYMMDD to the end

' Do not modify anything below this line

Set oShell = WScript.CreateObject("WScript.Shell") 'Create As Object

Set oApp = CreateObject("Shell.Application") 'Create As Object

MyTarget =
l Folders\CD Burning")

Set oFolder = oApp.Namespace(MySource) 'Create As Object

oApp.Namespace(MyTarget).CopyHere oFolder.Items 'Copy the files that are in
the source folder

oApp.NameSpace(&H11).ParseName(MyCDRW).InvokeVerbEx "Write &these files To
CD" 'Kick off the wizard

Do until oShell.appactivate("CD Writing Wizard") 'Wait for Dialog to Appears

wscript.sleep 500


MyDateCode = mid(formatDateTime(Date, vbshort),9,2) &
mid(formatDateTime(Date, vbshort),4,2) & left(formatDateTime(Date,

oShell.appactivate("CD Writing Wizard") 'Make sure it's the current window

oShell.SendKeys MyCDName & " " & MyDateCode 'Type in our CD Name

oShell.appactivate("CD Writing Wizard") 'Make sure it's the current window

oShell.SendKeys "{Enter}" 'Continue wizard

Do until Not oShell.appactivate("CD Writing Wizard") 'Keep script running
until Dialog is gone,

wscript.sleep 500 ' or else the wizard will close


Set oApp = Nothing

Set oFolder = Nothing

Set oShell = Nothing

Sun, 08 Aug 2004 12:16:13 GMT  
 [ 1 post ] 

 Relevant Pages 

1. InvokeVerb and Wrting these files to CD under Windows XP

2. Writing print status in a file (windows xp)

3. Writing to a files comments in xp

4. Printing font samples from Font-CD...

5. Burn a CD in XP using VB Script

6. How can I start CD burning in XP from a VBScript

7. write script for copying files every sync

8. Copy from CD to H-Disk

9. Copy Default User profile from CD

10. Copy from CD without Read-Only set


Powered by phpBB® Forum Software