Jesse Posted June 4, 2009 Posted June 4, 2009 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!!
mmalves Posted June 4, 2009 Posted June 4, 2009 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
Jesse Posted June 4, 2009 Author Posted June 4, 2009 I made the change, but it didn't help. The bat file still works on it's own, but not through a scheduled task. Can ImgBurn even be called through Task Scheduler?
mmalves Posted June 4, 2009 Posted June 4, 2009 Then I guess ImgBurn doesn't work if it can't display its window
Jesse Posted June 4, 2009 Author Posted June 4, 2009 Is there another method I can use to schedule an automated burn?
mmalves Posted June 4, 2009 Posted June 4, 2009 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.
Jesse Posted June 4, 2009 Author Posted June 4, 2009 Hmm... It works if I choose 'Run only when the user is logged in' but doesn't work if I choose 'Run whether user is logged in or not'. I guess I just won't log out of the computer
mmalves Posted June 4, 2009 Posted June 4, 2009 When it doesn't work and you log back on, is there a ImgBurn.exe in memory?
Jesse Posted June 4, 2009 Author Posted June 4, 2009 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.
Recommended Posts