You should use something like the Personal Folders Backup tool instead of killing Outlook (see http://www.microsoft.com/d
Main Topics
Browse All TopicsI am having problems with the Vista backup utility, and have written a DOS script to auto-run, compress (rar), and backup all of my data every night. The problem is, I leave Outlook running all the time, and Yahoo Widgets which monitors Outlook. Both apps lock the Outlook database, and it will not backup.
I tried Vista backup but it won't work for me because it automatically includes my OS drive, and I don't want that.
I have tried installing the XP backup utility, but shadow copy produces errors in Vista, so that won't work either.
My last option is to use taskkill to stop Outlook and Yahoo Widgets just prior to backing up the data. This will allow the .pst database to be copied.
Now to my question... when I taskkill Outlook it produces an error on relaunch, and Windows indicates Outlook closed unexpectedly, and scans the database for errors. As well, Yahoo Widgets produces errors, and Vista searches for a solution. Yahoo Widgets will not close properly because the user must select to close the program due to the fact that it closed unexpectedly. The database remains locked, and will not backup.
Is there a way I can close those two applications properly from the DOS script, without doing a force close uing taskkill?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You should use something like the Personal Folders Backup tool instead of killing Outlook (see http://www.microsoft.com/d
I actually have it installed, and have tried to use that an option, but it requires user intervention, and I have to manually close Outlook for it to run. It won't run if Outlook is open, and I don't think I can set it to automatically run at a specific time? If I could, then that would be a perfect option!
The Outlook PST backup utility as well is a .dll file installed in the office11 folder, and an error appears when I try to launch from DOS script stating "This program cannot be run in DOS mode". I don't think this is an option for me.
Regrettably, I had no problems when I used XP. The backup utility in XP worked perfectly. With MS backup the shadow copy worked flawlessly, I was able to get my pst file no problems and then get everything else with my .bat file. I can manage all other files with a DOS bat, just cannot get the pst file. I don't want to backup my entire OS because it requires too much room, and I have a restore clone of my primary drive with apps on DVD. Since I "downgraded" to Vista however, the backup utility is just not working for me! Have been considering trying XP64 bit to resolve my backup issue... but then... might be dealing with other problems.
I'm sorry, have been not aware that this tool is capable of neither automatic nor online backups. AFAIK (now) there are no (cheap) tools to perform online PST backups ... So let's return to the "stop Outlook" workaround you used already.
With process (http://www.beyondlogic.or
(the ping is for implementing a 60 second sleep)
Hi, thanks so much for this little app. I think I'm getting somewhere with this. Where would you suggest I throw the process.exe app? Into my system32 directory and then can I simply reference the pathway there to access directly from the batch script?
The main reason I keep Outlook running is because I do a fair amount of work in the evening and compose emails then, setting them to be sent automatically the next morning.
When I run your script it gracefully closes Outlook as you mentioned. Outlook produces a popup indicating there are unsent messages, but it closes after 30 seconds anyways, and your 60 second delay covers that, so perfect... thankyou.
I do receive an error in DOS after the 60 pause, however, which is,
"OUTLOOK.EXE (PID 5344) failed to respond to WM_COSE. Terminating Now."
Strange, because at that point, Outlook has already closed and shut down. The script then backs up the pst files without any problem.
Relaunch of Outlook is fine, without any scan from windows of the database. It does not product the error that Outlook was unexpectedly closed.
The script, however, does hang after Outlook is relaunched, it doesn't get to the final line to complete the script, and doesn't complete the batch file to close the DOS window. Can't do a ctrl-c either to stop the batch file. By the way, neither did my original script complete either.
Other than that, this seems to work perfectly!
I did remove the process close for YahooWidgets, and kept the taskkill with switch to force it.
process -q OUTLOOK.EXE 120 might help, as it waits for 120 seconds till killing. However, since the WM_Close is not answered in time, I guess the process utility does wait some 5 seconds, than reporting that timeout messsage, and waiting the time given (60 seconds as default, or with above line 120 seconds) to kill a already killed process.
When I try to start outlook from command line, there is no wait. But you can try to call outlook with a start command, to detach it from the batch file:
start "It's Outlook" outlook.exe
The ping will wait anyway, so YahooWidgets will hit a running Outlook, I hope.
And for stuff like process.exe, I always have one tools folder collecting all the stuff I need, and part of PATH.
As for the script, seems to be working well. Yahoo Widgets comes up fine. The DOS window stays open, but that is fine because I can see the processes that ran, and which files were backed up. How long does the ping wait for, and how would I adjust the length of time?
Regardless, everything works great! Thank you so much!
Business Accounts
Answer for Membership
by: rotnfirePosted on 2009-01-24 at 00:36:49ID: 23455654
I added the switch to the taskkill to force all child processes to close, and that seems to have solved my problem of getting the database to backup.
However, I still have a problem that my code will not run all the way through. It will hang after it relaunches Outlook. I tried entering pauses between the code lines 6-7 and 7-8, but that didn't help. The script hung after relaunching Outlook, and didn't reach the pause before relanching YahooWidgets.
What am I missing?
Thanks in advance for your help.
Select allOpen in new window