Avatar of KJS69
KJS69
 asked on

batch file to kill a process, wait 10 seconds, then delete a file

O/S: Winodws 2000 sp4, Outlook 2003

I'm looking to create a batch file ("delete outcmd.bat") that kills a user's Ootlook.exe, waits 5 seconds and then deletes their outcmd.dat, frmcache.dat, extend.dat. My code simply reminds them to exit out of Outlook then deletes the files. So, I need the kill process part and the wait part. How would I do this? Anything in a Resource Kit that might help and if so which resource Kit. Thank you!
@echo off
echo Attempting deletion of Outlook files: outcmd.dat, frmcache.dat, extend.dat
echo Please close of Outlook (File, Exit out) or files will NOT be deleted
pause
echo -----------------------------------------------------------------------
cd "C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook"
echo Attempting to delete outcmd.dat...
del outcmd.dat
cd "C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\FORMS"
echo Attempting to delete frmcache.dat...
del frmcache.dat
cd "C:\Documents and Settings\%username%\Local Settings\Application Data\Microsoft\Outlook"
echo Attempting to delete extend.dat...
del extend.dat
echo -----------------------------------------------------------------------
echo Process completed !
pause

Open in new window

Windows Batch

Avatar of undefined
Last Comment
knightEknight

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
knightEknight

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
KJS69

ASKER
Perfect, thank you. I do not seem to have taskkill on Winodws 2000 Pro. Do I get that from a Resource Kit, which one?
SOLUTION
knightEknight

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy