Jump to content

Having trouble running ImgBurn with Scheduled Tasks


Jesse

Recommended Posts

I may be going about this the wrong way, but this is what I've done so far. I have a large SQL database dump that I need to backup to a BD-RE each morning. I have a created a bat file to do this, and the bat file runs fine on its own. I've added a scheduled task to Windows (running Vista) to execute the bat file every morning at 5:00 am, and assigned it to a domain admin account and told it to run whether or not I am logged into the computer. After creating the task, I ran it manually while logged into the computer. It copied over my SQL dump, but then nothing happened. ImgBurn did not load or burn the disc. What am I missing here?

 

Here's my bat file:

@ECHO OFF
:START
ECHO Mapping T:...
net use T: \\san\archive
IF errorlevel 1 GOTO QUIT
ECHO Copying the SQL .bak file...
copy "T:\SQL Backup\itiserver_db_*.bak" "D:\burn"
IF errorlevel 1 GOTO QUIT
ECHO Changing to the IMGBURN directory...
C:
cd "C:\Program Files\ImgBurn"
IF errorlevel 1 GOTO QUIT
ECHO Starting the Burn...
ImgBurn.exe /MODE BUILD /SRC "D:\Burn" /DEST G: /ERASE /FILESYSTEM "UDF" /UDFREVISION "2.01" /VOLUMELABEL "Director SQL Backup" /SPEED 2x /VERIFY YES /DELETESOURCE NO /EJECT YES  /WAITFORMEDIA /START /ROOTFOLDER YES /CLOSESUCCESS /NOIMAGEDETAILS
IF errorlevel 1 GOTO QUIT
ECHO Backup complete.
ECHO Flushing the Burn folder...
del /Q D:\burn\*.*
IF errorlevel 1 GOTO QUIT
ECHO All Done!
pause
exit

:QUIT
echo There was an error!
pause
exit

 

Thanks for a great program!!

Link to comment
Share on other sites

Instead of changing to ImgBurn's directory, try calling it straight like this:

@ECHO OFF
:START
ECHO Mapping T:...
net use T: \\san\archive
IF errorlevel 1 GOTO QUIT
ECHO Copying the SQL .bak file...
copy "T:\SQL Backup\itiserver_db_*.bak" "D:\burn"
IF errorlevel 1 GOTO QUIT
ECHO Starting the Burn...
"C:\Program Files\ImgBurn\ImgBurn.exe" /MODE BUILD /SRC "D:\Burn" /DEST G: /ERASE /FILESYSTEM "UDF" /UDFREVISION "2.01" /VOLUMELABEL "Director SQL Backup" /SPEED 2x /VERIFY YES /DELETESOURCE NO /EJECT YES  /WAITFORMEDIA /START /ROOTFOLDER YES /CLOSESUCCESS /NOIMAGEDETAILS
IF errorlevel 1 GOTO QUIT
ECHO Backup complete.
ECHO Flushing the Burn folder...
del /Q D:\burn\*.*
IF errorlevel 1 GOTO QUIT
ECHO All Done!
pause
exit

:QUIT
echo There was an error!
pause
exit

Also, if you want to tweak the message shown after ImgBurn's operation have a look here ;)

Link to comment
Share on other sites

I was wrong, ImgBurn works fine being called from a scheduled task, just tried it now and it burned a disc while no user was logged on :)

 

Try this:

@ECHO OFF
:START
ECHO Mapping T:...
net use T: \\san\archive
IF errorlevel 1 GOTO QUIT
ECHO Copying the SQL .bak file...
copy "T:\SQL Backup\itiserver_db_*.bak" "D:\burn"
IF errorlevel 1 GOTO QUIT
ECHO Starting the Burn...
"C:\Program Files\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDMODE DEVICE /SRC "D:\burn" /DEST "G:" /FILESYSTEM "UDF" /UDFREVISION "2.01" /VOLUMELABEL "Director SQL Backup" /SPEED 2x /ERASE /TESTMODE NO /VERIFY YES /DELETESOURCE NO /EJECT YES /START /CLOSESUCCESS /WAITFORMEDIA /NOIMAGEDETAILS /ROOTFOLDER YES
IF errorlevel 1 GOTO QUIT
ECHO Backup complete.
ECHO Flushing the Burn folder...
del /Q D:\burn\*.*
IF errorlevel 1 GOTO QUIT
ECHO All Done!
pause
exit

:QUIT
echo There was an error!
pause
exit

You might need to use Task Manager to kill any ImgBurn.exe process(es) that may be stuck from previous attempts.

Link to comment
Share on other sites

I'm not logging out, I'm manually starting the task to make sure it works. When "Run whether user is loggin in or not" is checked - even if I'm still logged in - ImgBurn does not load. It isn't in my list of processes. The bat file is being launched though, I can see that my file copy runs and a new copy has been moved over, but its like the process pauses when it comes to actually launch imgburn.

 

I'm not that worried about it, I usually never log out anyway, I just lock the screen. As long as it works with "Run only when user is logged in" I'm happy.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.