Subscribe

Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts

Search

Archives

Burn files from the command line

Post image for Burn files from the command line

by Steve Wiseman on November 7, 2014 · 10 comments

in Backups,BAT Files


.

Some time ago we released a free utility to burn files to DVD/CD from the command line.

It has been quite popular, but one issue has been found.

The utility did not close the burn session – which is fine in most situations. If you burned to a disk a second time and it had the space it would just burn the data to a new session and the old session would be hidden.

Unfortunately on some drives the new session is the one that is hidden. This means you could burn to the disk, get no errors, and have no way of accessing that data.

Our fix is to force it to finalize the session for each burn. This guarantees you will get a failure if it tries to write to a disk that is already being used.

Lets go through how the utility works.

It is a program you execute from the command line, and can be used in batch files:

Here are the command line options

-You can eject the drive

-You can erase disks

-You can set the label when writing to the disk

-You can close the tray

Lets see some examples.

If I wanted to backup c:\temp to my writable DVD on E: it would look like this:

burndisk.exe /write c:\temp e:

If you wanted a custom volume label (It defaults to the current date), you could use this:

burndisk.exe /write c:\temp e: /vol VOL_LABEL_1

To eject the drive, you can call it like this:

burndisk.exe /eject e:

To close that drive tray:

burndisk.exe /close e:

To erase a drive:

burndisk.exe /erase e:

You can use the ERRORLEVEL value for conditional statements in your batch file (Like send you an email if it fails)

Here is an example bat file that checks the result of the BurnDisk.exe output:

@ECHO OFF

REM Backup our files to DVD or CD ROM

burndisk.exe /write c:\Backup e:

REM Check our result

IF %ERRORLEVEL%==0 goto COMPLETE

REM ERROR HANDLING HERE

:COMPLETE

Get the latest copy from our website here:

BurnDisk.exe

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 10 comments… read them below or add one }

1 Jessie W November 7, 2014 at 11:33 am

Thanks for a great utility. We have been using this for backups for quite some time.

2 Mike November 7, 2014 at 11:34 am

Hi Steve,

Does this work on Windows 8?

3 Steve Wiseman November 7, 2014 at 11:34 am

Hi Mike,

Yes it works on Windows 8, and even on the beta of Windows 10.

4 Russ November 7, 2014 at 11:47 am

Thanks for the update, But you did not tell how to force it to finalize the session after the burn.

5 Steve Wiseman November 7, 2014 at 1:21 pm

Hi Russ,

It always finalizes the session now. So there is no option to call

6 Ian November 26, 2014 at 5:32 am

I am trying to burn DL+R on a dual layer burner (CDBURNERXP) on Windows XP with the imap2 update, which has been tested against the standard of media and same burner successfully. Burndisk is returning “Could not write files to disk” %ERRORLEVEL% Incorrect Functional

Any assistance would be appreciated

7 Ian Feekings November 27, 2014 at 5:50 am

For a future update I would like to suggest an /info switch that could perhaps return information about the burner and media being used which may save some reburns! Got a lot of potential thanks!

8 Pete December 16, 2014 at 10:15 pm

Hi Steve, I was looking for a simple utility to burn files via a batch file and came across this great tool, however I found that it will refuse to erase a CD and write to it again (fatal error) after it wrote to it happily the first time. When I erase manually first(ImgBurn for example) it again writes to it. Any ideas? Thanks Pete

9 Steve Wiseman February 13, 2015 at 6:56 am

Hello Ian,

Interesting idea. Thanks for the great suggestion.

10 Steve Wiseman February 13, 2015 at 6:58 am

Hi Ian,

Unfortunately with burndisk we don’t write the code for burning at all. We simply call an API built into windows that does the work for us. We have noticed that Windows XP support for this API (Even with the IMAP2 update) has not been too great.

A better way would be if we wrote the burn software from scratch, but that is a huge job and is not the focus of our work right now.

Leave a Comment

Category Links - Windows Forum - Exchange Forum