I wrote a batch script to make a backup of my Thunderbird client on Windows 7. It works perfectly, but I am having issues with the logging part.
Essentially, I would like it to see what is going on in the command window when it runs, as well as to log all output to a .log file.
The problem: It logs to a file, but runs without anything in the command window. Then after it completes, it runs AGAIN, but this time displays what's happening in the command window.
Included: The script. The log file.
Script:
@ECHO ON
rem
call :Logit>>%Desktop%\"%DATE:~7,2%.%DATE:~4,2%.%DATE:~-4%-ThunderbirdBackup".log
:Logit
echo Backup Start at = %date% %time%
echo Beginning Automatic Backup and Encryption for Thunderbird
echo This will take approximately 45 seconds to complete
echo Killing Thunderbird.exe
taskkill /F /IM thunderbird.exe
echo Give the computer a moment to complete task
timeout /T 3
echo Zipping to Desktop
"C:\Program Files\7-Zip\7z.exe" a -t7z %Desktop%\"%DATE:~7,2%.%DATE:~4,2%.%DATE:~-4%-ThunderbirdBackup".7z %AppData%\Thunderbird\Profiles\ -m0=lzma2 -mx3 -mmt=8 -mhe=on
echo Backup Complete at = %date% %time%
Thank you for any assistance you cold lend.
The log: ThunderbirdScript-Log-Pastebin