Jump to content

Automate CD Burn?


Recommended Posts

Hi.

I'm wondering if there is a way to use XP:s builtin cd burn api with

VBScript to automate cd burn? The GUI( cd Writing wizard) part is simple,

just rightclick and send files to the CD drive"staging area" and then click

on "Write this files to cd". The send part is simple with VBscript, just copy

files to the "Staging area". But to start the burning I only found one way

and thats to use "send key" to a open window. Is there any other way?

/Twinnis

Link to comment
Share on other sites

Hi.

I'm wondering if there is a way to use XP:s builtin cd burn api with

VBScript to automate cd burn? The GUI( cd Writing wizard) part is simple,

just rightclick and send files to the CD drive"staging area" and then click

on "Write this files to cd". The send part is simple with VBscript, just copy

files to the "Staging area". But to start the burning I only found one way

and thats to use "send key" to a open window. Is there any other way?

/Twinnis

Why would you ask about VBscripting on an AutoIt forum???????

There are a lot of good VBscript forums out there. (Google is your friend)

I won't tell you how to do it in VBS but I will tell you how to do it in AutoIt.

$File = "C:\myfile.txt"
FileCopy($File, StringReplace($File, "C:\",@AppDataDir & "\Microsoft\CDBurning\"))

BTW yu might want to take a look at this utility

http://isorecorder.alexfeinman.com/CreateCD.htm

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Why would you ask about VBscripting on an AutoIt forum???????

There are a lot of good VBscript forums out there. (Google is your friend)

I won't tell you how to do it in VBS but I will tell you how to do it in AutoIt.

$File = "C:\myfile.txt"
FileCopy($File, StringReplace($File, "C:\",@AppDataDir & "\Microsoft\CDBurning\"))

BTW yu might want to take a look at this utility

http://isorecorder.alexfeinman.com/CreateCD.htm

Hi and thanks for your answer.

I am sorry about the VBscript part. Its a cut and paste mistake because i asked this question in a VB forum first and forgot to edit it before I send it here. I am using AutoIT but since I cant find the answer i thought that I should try to broaden the field of brains that perhaps could help me.

Yes I have read about Alex Feinmans utility. I havent tried it yet because i wanted a clean app with no extra files or exe in the first place. But since I use a .ini-file in my latest version I allready missed that goal :whistle: .

My project is to make a backup-app that remind users when importent files are changed and needs to be backed up. And I used the send key methode, but I dont think its a very stable way of solving it. And also it doesn´t looks very nice with a lot of windows opens. So, what I wanted was a way to kick of the actuall burning without the send key methode, maybe from WMI( thats why I asked about it in a VBforum).

And it now seems that Alex Feinmans utility is the best way, at least at the moment;). Thanks again Geosoft.

/Twinnis

Link to comment
Share on other sites

Hi and thanks for your answer.

I am sorry about the VBscript part. Its a cut and paste mistake because i asked this question in a VB forum first and forgot to edit it before I send it here. I am using AutoIT but since I cant find the answer i thought that I should try to broaden the field of brains that perhaps could help me.

Yes I have read about Alex Feinmans utility. I havent tried it yet because i wanted a clean app with no extra files or exe in the first place. But since I use a .ini-file in my latest version I allready missed that goal :whistle: .

My project is to make a backup-app that remind users when importent files are changed and needs to be backed up. And I used the send key methode, but I dont think its a very stable way of solving it. And also it doesn´t looks very nice with a lot of windows opens. So, what I wanted was a way to kick of the actuall burning without the send key methode, maybe from WMI( thats why I asked about it in a VBforum).

And it now seems that Alex Feinmans utility is the best way, at least at the moment;). Thanks again Geosoft.

/Twinnis

No problem

BTW once the files are in the proper folder (I gave you that code) then you would use

$Shell = ObjCreate("Shell.application")
$Folder = $Shell.namespace("D:\") ;; Chamge to your CDRW drive letter
$Folder.InvokeVerb "Write &these files to CD" ;; See the note below this code
Sleep(1000)
;; From here on you have to use Send() but I think that the second window has a Finish button
;; so use the spy utility to get the classname of the button and then ControlClick("button5) or whatever button it is.

NOTE: Different installations of XP may use a different verb. Right click on the CDRW drive in explorer and get the exact wording.

If there is an underlined character then preceed it with "&" as shown above (&these)

The verb string is case sensitive.

HTH

Edit;; I should also have pointed out that the CD Writing Wizard is a dialog invoked by Explore.exe. I think that the dll file involved is Shell32.dll but I.m not positive. Someone wo knows the inner workings of the dll file may have a better method ussing a DLLStruc.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

No problem

BTW once the files are in the proper folder (I gave you that code) then you would use

$Shell = ObjCreate("Shell.application")
$Folder = $Shell.namespace("D:\") ;; Chamge to your CDRW drive letter
$Folder.InvokeVerb "Write &these files to CD" ;; See the note below this code
Sleep(1000)
;; From here on you have to use Send() but I think that the second window has a Finish button
;; so use the spy utility to get the classname of the button and then ControlClick("button5) or whatever button it is.oÝ÷ ØÓ8}êÞا²Ö¥«b¢{(}sæk+¬y§b}÷«z{oz¶ÑmrXíàEgk÷¢ìiÞ­©Ýëmç±iËp¢·b¶«z+éÝz¹bçªÚr׫¶§¦·yçb·­«¨µ©©ªê-jË!£ ÚnÞjjmëN¯z¶ì¶¸§+jǬz{"¶+Þ1Äv+H².Ö¥²Z½êh{^v­¶­¶
jâ¶)àZ,ڭجiØ"ú$yÖòe¢·Åâ-)䶭¶Wâ觾oyجJ¥}Vî´§¢Úh²+b½ä¨ê'{
$,¶¢w«Âäx,¡ûayÙe~)^¬¡j÷mëmz¹¶ºË",´­®ç?ªê-xx¶¸w*.®Ç+Fä¨~Öî¶+]¡ë'·
+ú+äáyê뢹²Æ y«"¶ÊkzǧµçbØ^IÈ­yÊ'²^Ó~¢W^¬ï¢Gz¶êºV®+^jjmë~)^²Ú«¨·}à´7
éÝyÚÜØ Ýò-¯+hºÇ¬¥ç"jWè׫jjG×S2
©º×«)¶'+n®

then AutoIt doesn´t like the &H11. The vbscript opens the CD writing wizard fine. So what could be the problem?

Thanks in advance.

Best regards

Twinnis

Link to comment
Share on other sites

Hi.

I tried your script GEOSoft but it doesn´t work for me. The errormessage as its presented in the Sciteconsole:

$Folder.InvokeVerb "Write &these files to CD"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

!>AU3Check ended.rc:2

And if I try to use specialfolder &H11(MyComputer) like the VBScript http://groups.google.co.uk/group/microsoft...0b767e531560715

$oApp.NameSpace(&H11).ParseName($MyCDRW).InvokeVerbEx ("Write &these files to CD" );Kick off the wizard

then AutoIt doesn´t like the &H11. The vbscript opens the CD writing wizard fine. So what could be the problem?

Thanks in advance.

Best regards

Twinnis

I found the answer that ptrex wrote about specialfolders in Example scripts. thank you for that :whistle:

Its $My_Computer= 0x11 in AutoIt.

/Twinnis

Link to comment
Share on other sites

Hi again.

I have a problem with the CD Wrting Wizard window. When I run script the wizard opens for about one second and then close. The problem is that the time is short to sen a Controlclick. Is there anyone that knows what could be wrong?

AutoItSetOption("MustDeclareVars", 1) 

Dim $MyCDRW, $MySource, $MyTarget, $MyCDNAME

Dim $oShell, $oApp, $oFolder

Const $My_Computer = 0x11


$MyCDRW = "D:\" 

$MySource = "C:\test" 

$MyCDNAME = "Backup" 


$oApp = ObjCreate("Shell.Application") 

$MyTarget = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "CD Burning")

$oFolder = $oApp.Namespace($MySource) 

$oApp.Namespace($MyTarget).CopyHere ($oFolder.Items )

$oApp.NameSpace($My_Computer).ParseName($MyCDRW).InvokeVerbEx("Write &these files to CD")

ControlClick("CD Writing Wizard", "", "&Next >")

Best regards Twinnis

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...