Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo deleting files...
- tasklist /FI "IMAGENAME eq file1.exe" | find /I /N "file1.exe"> nul 2>&1
- if errorlevel 1 (
- echo file1.exe is not running
- goto :delete
- ) else (
- taskkill /F /IM file1.exe> nul 2>&1
- if errorlevel 1 (
- echo Killing process file1.exe... Failed!
- ) else (
- goto :delete
- )
- )
- :delete
- ren c:file1.exe c:tmp.tmp> nul 2>&1
- if errorlevel 1 (
- echo Deleting file1.exe... Access Denied!
- ) else (
- del /q /f "C:tmp.tmp"> nul 2>&1
- echo Deleting file1.exe... Success!
- )
- for %%f in (file1 file2 file3) do
- for %%p in (path1 path2 path3) do (
- taskkill %f etc
- del %p etc
- )
- for %%F in ("path1file1" "path2file2" "path3file3") do (
- taskkill %%~nxF
- del %%F
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement