Advertisement
Guest User

Untitled

a guest
May 25th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. @echo off
  2. echo deleting files...
  3. tasklist /FI "IMAGENAME eq file1.exe" | find /I /N "file1.exe"> nul 2>&1
  4. if errorlevel 1 (
  5. echo file1.exe is not running
  6. goto :delete
  7. ) else (
  8. taskkill /F /IM file1.exe> nul 2>&1
  9. if errorlevel 1 (
  10. echo Killing process file1.exe... Failed!
  11. ) else (
  12. goto :delete
  13. )
  14. )
  15. :delete
  16. ren c:file1.exe c:tmp.tmp> nul 2>&1
  17. if errorlevel 1 (
  18. echo Deleting file1.exe... Access Denied!
  19. ) else (
  20. del /q /f "C:tmp.tmp"> nul 2>&1
  21. echo Deleting file1.exe... Success!
  22. )
  23.  
  24. for %%f in (file1 file2 file3) do
  25. for %%p in (path1 path2 path3) do (
  26. taskkill %f etc
  27. del %p etc
  28. )
  29.  
  30. for %%F in ("path1file1" "path2file2" "path3file3") do (
  31. taskkill %%~nxF
  32. del %%F
  33. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement