monoceres Posted July 7, 2008 Author Share Posted July 7, 2008 One question : How can I delete a folder/file from the fs ? Is it possible ? (I'm planning to do an app for this UDF ... ) Cheers, L|M|TER I will make a function for it, but you can do it yourself quite simple: $oFileSystem.RemoveTree("Some dir") muttley Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
monoceres Posted July 8, 2008 Author Share Posted July 8, 2008 I will make a function for it, but you can do it yourself quite simple: $oFileSystem.RemoveTree("Some dir") muttley Scratch that, this is the correct way of doing it: $oRoot=$oFileSystem.Root $oRoot.RemoveTree("Some tree structure") Silly me Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
monoceres Posted July 8, 2008 Author Share Posted July 8, 2008 Minor update, _IMAPI2_RemoveFolderFromFS() added muttley Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
lalamonkey Posted July 19, 2008 Share Posted July 19, 2008 I am studying how to implement burning cd or dvd by useing imapi.Now I meet some questions. I have download the KB932716 update file,but it appears somes problems. "Setup cannot update your Windows XP files because the language installed on your system is different from the update language." How should I do ? Link to comment Share on other sites More sharing options...
redfive19 Posted August 14, 2008 Share Posted August 14, 2008 Just a quick question....do you know how to find out information about the burner? I want to know if a burner can burn dvd-r's, dvd+r's, etc...THANKS! Link to comment Share on other sites More sharing options...
monoceres Posted August 14, 2008 Author Share Posted August 14, 2008 Just a quick question....do you know how to find out information about the burner? I want to know if a burner can burn dvd-r's, dvd+r's, etc...THANKS!Hi!I will look into it and post an update Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
monoceres Posted August 14, 2008 Author Share Posted August 14, 2008 (edited) Hi!I will look into it and post an update Two new functions added._IMAPI2_DriveGetSupportedMedia() - Returns an array of media types that is supported by a drive that corresponds to the constants defined in the top of the UDF_IMAPI2_DriveMediaIsBlank() - Returns true if the inserted media in a drive is blank Edited August 14, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
monoceres Posted August 15, 2008 Author Share Posted August 15, 2008 New update!Finally some iso support! New functions:_IMAPI2_BurnImageToDrive_IMAPI2_AddFileToFS_IMAPI2_CreateFSForMedia_IMAPI2_FSCountDirectories_IMAPI2_FSCountFiles_IMAPI2_FSItemExists_IMAPI2_DriveMediaFreeSpace_IMAPI2_DriveMediaTotalSpaceEnjoy Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
redfive19 Posted August 26, 2008 Share Posted August 26, 2008 So great, thank you!!! Link to comment Share on other sites More sharing options...
cyanidemonkey Posted October 9, 2008 Share Posted October 9, 2008 this is great UDF, but just have a few Q's i'm trying to get a progress feedback bat can't get it to work, the best i've done is that it chages once at the end, but it don't show progress as it burns, am i using the function wrong? modified IMAPI2_Example.au3 $fs=_IMAPI2_CreateFSForDrive($drive,"Sample Title"); Create a filesystem _IMAPI2_AddFolderToFS($fs,$folder) ProgressOn("Progress Meter", "Ouch! that burns!", "ready...") _IMAPI2_BurnFSToDrive($fs,$drive,"_Progress") ProgressSet(100 , "Done", "Complete") sleep(500) ProgressOff() _IMAPI2_DriveEject($drive) Func _Progress($array) ; ConsoleWrite("Current action: "&$array[0]&@CRLF) ; ConsoleWrite("Remaing time: "&$array[1]&@CRLF) ; ConsoleWrite("Elapsed time: "&$array[2]&@CRLF) ; ConsoleWrite("Total time: "&$array[3]&@CRLF) ProgressSet((Round($array[2])/Round($array[3])*100),"Current action: "&$array[0] & " Remaing time: "&$array[1] & " Elapsed time: "&$array[2] & " Total time: "&$array[3]) EndFunc also, when i put in a disc and click OK the default windows "what do you want to do with this disc" dialog box comes up, is there a way i can stop it from coming up? (WinXP/SP3) or should i just WinActive to check for it and close it? My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
monoceres Posted October 9, 2008 Author Share Posted October 9, 2008 this is great UDF, but just have a few Q'si'm trying to get a progress feedback bat can't get it to work, the best i've done is that it chages once at the end, but it don't show progress as it burns, am i using the function wrong?Snippedalso, when i put in a disc and click OK the default windows "what do you want to do with this disc" dialog box comes up, is there a way i can stop it from coming up? (WinXP/SP3) or should i just WinActive to check for it and close it?Ii actually works that way for me too, but my burner is in a really bad shape and since nobody else noticed this I thought it was my burner (my computer almost completely freeze when burning anything). I will try to find a solution when I get the time I think the WinActive solution will wrk, but I'm convinced that there is another solution, same as above. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Alynuzzu Posted October 10, 2008 Share Posted October 10, 2008 God job! Link to comment Share on other sites More sharing options...
Spiff59 Posted October 21, 2008 Share Posted October 21, 2008 Does anyone know the steps required to append files to an un-finalized CD-R? I'm thinking you have to read in the FS somehow and then combine it with your new files before writing it backl or you'll lose reference to the existing files. Anyone tried getting this to work? Thanks. Link to comment Share on other sites More sharing options...
monoceres Posted October 21, 2008 Author Share Posted October 21, 2008 Does anyone know the steps required to append files to an un-finalized CD-R? I'm thinking you have to read in the FS somehow and then combine it with your new files before writing it backl or you'll lose reference to the existing files.Anyone tried getting this to work?Thanks.Hi!There are methods in the IFileSystemImage object that allows you to import the filesystem on the inserted media. When I get the time, I'll incorporate them into the UDF Methods in the IFileSystemImage objecthttp://msdn.microsoft.com/en-us/library/aa365634(VS.85).aspx Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Spiff59 Posted October 22, 2008 Share Posted October 22, 2008 Hi!There are methods in the IFileSystemImage object that allows you to import the filesystem on the inserted media. When I get the time, I'll incorporate them into the UDF Methods in the IFileSystemImage objecthttp://msdn.microsoft.com/en-us/library/aa365634(VS.85).aspxI found this out there... seems like just what the doctor ordered:"Creating a Multisession Disc"http://msdn.microsoft.com/en-us/library/bb870772(VS.85).aspx Link to comment Share on other sites More sharing options...
dansxmods Posted October 22, 2008 Share Posted October 22, 2008 (edited) This will help me imensly. Not sure how to spell that. I found a bug though. I am running xp with sp3 and came across this error msg. C:\Program Files\AutoIt3\Include\IMAPI2.au3 (274) : ==> Subscript used with non-Array variable.: Return StringLeft($sTemp[0], 1) Return StringLeft($sTemp^ ERROR How can I make it work properly? And now this one for some reason: C:\Program Files\AutoIt3\IMAPI2_Example.au3 (13) : ==> Subscript used with non-Array variable.: $drive = _IMAPI2_DriveGetObj($ids[2]) $drive = _IMAPI2_DriveGetObj($ids^ ERROR Help? Edited October 22, 2008 by dansxmods Link to comment Share on other sites More sharing options...
Spiff59 Posted October 22, 2008 Share Posted October 22, 2008 (edited) This will help me imensly. Not sure how to spell that. I found a bug though. I am running xp with sp3 and came across this error msg. C:\Program Files\AutoIt3\Include\IMAPI2.au3 (274) : ==> Subscript used with non-Array variable.: Return StringLeft($sTemp[0], 1) Return StringLeft($sTemp^ ERROR How can I make it work properly? And now this one for some reason: C:\Program Files\AutoIt3\IMAPI2_Example.au3 (13) : ==> Subscript used with non-Array variable.: $drive = _IMAPI2_DriveGetObj($ids[2]) $drive = _IMAPI2_DriveGetObj($ids^ ERROR Help? I'm guessing your errors are actually a result of a prior statement not populating those variables. Did you install Microsoft's KB932716-V2 IMAPI2 update? I scrolled down and went with the 32-bit XP SP2 download. MS claims the hotfix was included in SP3 but googling "IMAPI2" and "SP3" shows others have found missing IMAPI2 dll's after the SP3 update. Manually reinstalling the SP2 version got things working for me. Edited October 22, 2008 by Spiff59 Link to comment Share on other sites More sharing options...
Spiff59 Posted October 24, 2008 Share Posted October 24, 2008 Microsoft's example for appending data to an exisiting open CD, resulting in a multi-session CD almost worked. I made a few coasters and eventually found that the following code works fine. It will add a folder to a blank CD, or, if the CD has data and is not finalized, it will load the data from the prior session, append your new data, then burn a new session with everything intact. I couldn't use the functions in the existing UDF as I needed to reference the Writer object prior to defining the FileSystem. So, here's some working test code, minus any frills, parm-passing, or error checks: expandcollapse popupDim $oDiscmaster, $oRecorder, $oWriter, $oFileSystem, $aDriveInfo[5][5], $drives ; MAIN ========================================================================= $folder = FileSelectFolder("Select source folder to burn to CD", "") If $folder = "" Then Exit _IMAPI2_Identify_Drives() ;For $x = 1 to $drives ; MsgBox(1,"","Drive " & $x & ": " & $aDriveInfo[$x][1] & " " & $aDriveInfo[$x][2] & " " & $aDriveInfo[$x][3] & " " & $aDriveInfo[$x][4]) ;Next _IMAPI2_FolderToCD($aDriveInfo[1][0]) MsgBox(1,"","Done!") Exit ; SUBROUTINES ================================================================== Func _IMAPI2_Identify_Drives() $oDiscmaster = ObjCreate("IMAPI2.MsftDiscMaster2") If Not IsObj($oDiscmaster) Then Msgbox(1,"","ObjCreate error: IMAPI2.MsftDiscMaster2") Exit EndIf $drives = 0 For $x = 0 To $oDiscmaster.Count() - 1 $oRecorder = ObjCreate("IMAPI2.MsftDiscRecorder2") If Not IsObj($oRecorder) Then Msgbox(1,"","ObjCreate error: IMAPI2.MsftDiscRecorder2") Exit EndIf ; bypass DaemonTools/Roxio/MagicISO virtual 'SCSI' drives as they crash IMAPI2. IDE and USB drives work fine. If StringMid($oDiscmaster.Item($x), 5, 4) <> "scsi" Then $oRecorder.InitializeDiscRecorder($oDiscmaster.Item($x)) $drives += 1 $aDriveInfo[$drives][0] = $oDiscmaster.Item($x); Drive Identifier $z = $oRecorder.VolumePathNames $aDriveInfo[$drives][1] = $z[0]; Drive Letter $aDriveInfo[$drives][2] = $oRecorder.VendorId $aDriveInfo[$drives][3] = $oRecorder.ProductId $aDriveInfo[$drives][4] = $oRecorder.ProductRevision EndIf Next $oDiscmaster = "" EndFunc ;------------------------------------------------------------------------------- Func _IMAPI2_FolderToCD($curdrive) $oRecorder = ObjCreate("IMAPI2.MsftDiscRecorder2") $oRecorder.InitializeDiscRecorder($curdrive) $oWriter = ObjCreate("IMAPI2.MsftDiscFormat2Data") $oWriter.recorder = $oRecorder $oWriter.ClientName = @ScriptName $oFileSystem = ObjCreate("IMAPI2FS.MsftFileSystemImage") If $oWriter.MediaHeuristicallyBlank Then $oFileSystem.ChooseImageDefaults($oRecorder) Else $oFileSystem.MultisessionInterfaces = $oWriter.MultisessionInterfaces $oFileSystem.ImportFileSystem() EndIf $oFileSystem.FileSystemsToCreate = 3; ISO9660 + Joliet $oFileSystem.VolumeName = "X-Ray Images" $oRootDir = $oFileSystem.Root $oRootDir.AddTree($folder, False) $oResult = $oFileSystem.CreateResultImage() $vStream = $oResult.ImageStream $oWriter.write($vStream); bypass to save cd'S during testing $oFileSystem = "" $oWriter = "" $oRecorder = "" EndFunc Link to comment Share on other sites More sharing options...
spudw2k Posted November 8, 2008 Share Posted November 8, 2008 @monoceres I got a ? for ya that maybe you can help me understand. I'm getting closer and closer to integrating this wonderful UDF into my burner script; and I was looking through your code and got confused about a func. The FSItemExists func. The func basically return the value of an object method called Exists. My question is (since I haven't got far enough along to test yet) what if you have two files of the same name but in different directories. Do you know how the object method handles that? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF  Link to comment Share on other sites More sharing options...
monoceres Posted November 8, 2008 Author Share Posted November 8, 2008 @monoceresI got a ? for ya that maybe you can help me understand. I'm getting closer and closer to integrating this wonderful UDF into my burner script; and I was looking through your code and got confused about a func. The FSItemExists func. The func basically return the value of an object method called Exists. My question is (since I haven't got far enough along to test yet) what if you have two files of the same name but in different directories. Do you know how the object method handles that?Hi!According to the msdn page it's the full path to the file.If you read it you will also see that my documentation is wrong about the return type (1 = directory, 2= file).However I just tested this function and I can't get it to work. I have no idea why. I will check it when I get time. It's not an essential function however so you might wanna think about keeping the info if a file has been added internally. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
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