Link to home
Start Free TrialLog in
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

ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KJS69
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial