1.

Solve : End process and delete file every 5 seconds?

Answer»

hey guys, having an issue with a virus that keeps REAPPEARING after i delete it, i am trying to temporaily fix this problem until a security update is released..

im not sure how to end a process through batch but i can delete with

@echo off
:loop
(put a timer in for 5 seconds)
(end procces)
del name.ext
goto loop


any help would really be appreciated, i think my works been hit with a NEW virus :s


batch is no way to solve a virus problem, this might just agitate it .

if you need an anti virus, there are many free
avast!
AVG
Bit defender

though if you are just looking for an answer, a simple timeout would
sleepQuote

Usage: sleep time-to-sleep-in-seconds
sleep [-m] time-to-sleep-in-milliseconds
sleep [-c] commited-memory ratio (1%-100%)

or using ping, replace 2 with the number of timeout you want
Quote
ping localhost -n 2 -w 1000 >nil

as for proccess kill, taskkill or tskill:
Code: [Select]TSKILL processid | processname [/SERVER:servername] [/ID:sessionid | /A] [/V]

processid Process ID for the process to be terminated.
processname Process name to be terminated.
/SERVER:servername Server containing processID (default is current).
/ID or /A must be specified when using processname
and /SERVER
/ID:sessionid End process running under the specified session.
/A End process running under ALL sessions.
/V Display information about ACTIONS being performed.yea i know, but its an exchange problem thats spamming our servers, like i said this is just temporary. ive found that i can use ping to set time but it looks very messy, any other way?sleep doesnt work, in XP anyway@echo off
:loop
tskill PROCESS (without .exe)
del File.ext
ping localhost -n 5 -w 1000>nul
goto loop

But PLEASE go to the computer viruses section to REMOVE your problem, not just hide a symptom. Quote from: Khasiar on OCTOBER 27, 2009, 04:44:31 PM
sleep doesnt work, in XP anyway

I use XP Pro and sleep works very well.

@echo off

Code: [Select]set /a c=0
:here
echo Sleep 3 seconds and repeat
echo when count is 10 quit
echo count = %c%
C:\batextra\sleep.exe 3

set /a c+=1

if %c% EQU 10 exit /b

goto here
OutPut:

C:\batextra> reploop.bat
Sleep 3 seconds and repeat
when count is 10 quit
count = 0
Sleep 3 seconds and repeat
when count is 10 quit
count = 1
Sleep 3 seconds and repeat
when count is 10 quit
count = 2
Sleep 3 seconds and repeat
when count is 10 quit
count = 3
Sleep 3 seconds and repeat
when count is 10 quit
count = 4
Sleep 3 seconds and repeat
when count is 10 quit
count = 5
Sleep 3 seconds and repeat
when count is 10 quit
count = 6
Sleep 3 seconds and repeat
when count is 10 quit
count = 7
Sleep 3 seconds and repeat
when count is 10 quit
count = 8
Sleep 3 seconds and repeat
when count is 10 quit
count = 9

C:\batextra>


Discussion

No Comment Found