twinnis Posted March 5, 2007 Posted March 5, 2007 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
GEOSoft Posted March 5, 2007 Posted March 5, 2007 (edited) 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? /TwinnisWhy 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 March 5, 2007 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!"
twinnis Posted March 6, 2007 Author Posted March 6, 2007 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 . 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
GEOSoft Posted March 6, 2007 Posted March 6, 2007 (edited) 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 . 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. /TwinnisNo 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 March 6, 2007 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!"
twinnis Posted March 12, 2007 Author Posted March 12, 2007 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
twinnis Posted March 12, 2007 Author Posted March 12, 2007 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 Its $My_Computer= 0x11 in AutoIt. /Twinnis
ptrex Posted March 12, 2007 Posted March 12, 2007 You are welcome !! If you post your script other people might enjoy it as well ?! regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
twinnis Posted March 12, 2007 Author Posted March 12, 2007 You are welcome !!If you post your script other people might enjoy it as well ?!regards,ptrexI will, after its finished, or if I need more help . /Twinnis
twinnis Posted March 14, 2007 Author Posted March 14, 2007 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now