Sign in to follow this  
Followers 0
kosamja

Disc Burner Script?

2 posts in this topic

#1 ·  Posted (edited)

Hi, I tried to make disc burner script, but I dont know:

1) how to remove cancel button and replace return button with burn button

2) how to exclude cd drives when showing files and folders list

3) to format cd dvd as usb drive from autoit script if it is not already formatted

4) also if it is possible to show some gui with percent of files copied.

Hope if someone can help me. 

Disc Burner.7z

Edited by kosamja

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Disc Burner.au3

; www.autoitscript.com/forum/topic/125293-choosefilefolder-new-version-11-feb-15/

#include "ChooseFileFolder.au3"

#NoTrayIcon

Local $sRet, $aRet
Global $sRootFolder = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1))
ConsoleWrite($sRootFolder & @CRLF)

; Register handlers
$sRet = _CFF_RegMsg()


; Choose multiple files/folders using checkboxes - all checked items returned
$sRet = _CFF_Choose("Press Return to start burning or Cancel to exit. Select files and folders to burn:", 555, 400, -1, -1, "", Default, 0 + 16, -1)
If $sRet Then
    $aRet = StringSplit($sRet, "|")
    $sRet = ""
    For $i = 1 To $aRet[0]
        $sRet &= $aRet[$i] & @CRLF
    Next
    FileWrite("Burn.txt", "" & @CRLF & @CRLF & $sRet)
    _FileWriteToLine("Burn.txt",1,"", 1)
    _FileWriteToLine("Burn.txt",1,"", 1)
    Run("Burn.bat")
Else
    FileDelete ( "Burn.txt" )
EndIf

LaunchFormat.au3

#include<GUIListView.au3>
#NoTrayIcon

Local $filepath = FileReadLine("drive.txt", 1)
Local $iPid = Run("explorer.exe " & $filepath, "",  @SW_HIDE)

Format.ahk

#NoEnv  ; 
#NoTrayIcon  ; 
SendMode Input  ; 
SetWorkingDir %A_ScriptDir%  ; 
SetWinDelay, 0 ;
SetTitleMatchMode, 2 ;

WinWait, Burn a Disc ahk_class #32770 ;
WinActivate, Burn a Disc ahk_class #32770 ;
Send {BACKSPACE}{ENTER} ;
WinWait, Formatting ahk_class #32770 ;
WinWaitClose, Formatting ahk_class #32770 ;
ExitApp ;

Burn.bat

@echo off
echo Waiting for disc to load...
del /f /q /a "file.txt" >nul 2>nul
del /f /q /a "folder.txt" >nul 2>nul
if exist burn.txt FOR /F "usebackq delims=" %%x IN ("burn.txt") DO if exist "%%x" (2>nul pushd "%%x" && (popd& echo %%x>>folder.txt) || echo %%x>>file.txt) else set "type=INVALID"
FOR /F "tokens=2* delims=    " %%A IN ('clewd.exe -t') DO SET CDROM=%%A
echo %CDROM% >drive.txt 
clewd.exe -w %* >nul
echo Disc loaded.
vol %CDROM% >nul 2>nul
if %errorlevel%==1 goto formatdisc
goto prepare

:formatdisc
echo Formatting disc...
start LaunchFormat.exe
start /wait Format.exe
echo Formatting finished.
goto prepare

:prepare
echo Copying files and folders to disc...
if exist file.txt FOR /F "usebackq delims=" %%x IN ("file.txt") DO copy /y "%%x" "%CDROM%\" >nul 2>nul

:folder
if exist folder.txt (
set /p folder=
)<folder.txt
set folder=%folder:~0,-1%

for %%a in ("%folder%") do set name=%%~na
for /f %%i in ("folder.txt") do set size=%%~zi
if %size%==0 goto continue
mkdir "%CDROM%\%name%" >nul 2>nul
regedit /s "Unstoppable Copier.reg"
start /wait hidec.exe /w UnstoppableCopier.exe "%folder%" "%CDROM%\%name%" >nul 2>nul
for /f "usebackq skip=1 delims=" %%x in ("folder.txt") do echo %%x>>folder.new
move /y "folder.new" "folder.txt" >nul 2>nul

if exist folder.txt (
set /p folder2=
)<folder.txt
set folder2=%folder2:~0,-1%
if "%folder2%"=="%folder%" goto continue
goto folder

:continue
echo Copying finished. Ejecting disc...
del /f /q /a "Burn.txt" >nul 2>nul
del /f /q /a "file.txt" >nul 2>nul
del /f /q /a "folder.txt" >nul 2>nul
start /b /wait devioctl.exe FLUSH %CDROM% >nul 2>nul
devioctl.exe EJECT %CDROM% >nul 2>nul
exit

If possible:

0) to do all file and folder copying from Disc Burner.au3 or just to show some gui with percent of files copied.

1) to remove cancel button and replace return button with burn button

2)  to exclude cd drives when showing files and folders list

3) to format cd dvd as usb drive from autoit script if it is not already formatted

 

Edited by kosamja

Share this post


Link to post
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
Sign in to follow this  
Followers 0