This batch is used to delete the Virus File autorun on each disk. inf, Folder. htt, Desktop. ini, and disable Disk Self-running in the registry. create three immune folders autorun. inf, Folder. htt, Desktop. ini.
This batch can be used to effectively protect and kill the autorun virus ..
Generally, this type of batch processing is not set in the Registry to prohibit Disk Self-running. I specifically added this to prevent self-running USB flash drives on hard disks. if this is not added, When you insert a USB flash drive, your USB flash drive runs on its own. it will still be infected with viruses.
Autorun virus is a common virus type. Using such a small batch processing can solve a big problem. We recommend that you use it.
------------- I am a split line, do not copy me ------------------------
@ Echo off
: 0
@ Echo 1. Full immunization
@ Echo 2. Cancel immunization
Set num =
Set/p num = select:
If "% num %" = "" goto 0
If "% num %" = "1" goto 1
If "% num %" = "2" goto 2
: 1
@ Echo off
Cd \
FOR % a IN (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: t: U: V: W: X: Y: Z:) DO (
If exist % (
Cd/d %
For % B in (autorun. inf, Folder. htt, Desktop. ini) do (
@ Echo y | Cacls % B/c/t/p Everyone: f
Rd/s/q \\? \ % A \ % B
Del/f/q/a % B> nul 2> nul
Md % B
Md % B \ immune do not delete ..\
@ Echo. This is an immune folder. Do not delete> % B \ immunization do not delete. txt
Copy % B \ immunization do not delete .txt % B \ immunization do not delete ..\
Attrib + r + s + a + h % B/s/d
@ Echo y | Cacls % B/c/t/d Everyone
)
)
)
Reg add "HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer"/V NoDriveTypeAutoRun/t REG_DWORD/d 255/f
Goto 0
: 2
@ Echo off
Cd \
FOR % a IN (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: t: U: V: W: X: Y: Z:) DO (
If exist % (
Cd/d %
For % B in (autorun. inf, Folder. htt, Desktop. ini) do (
@ Echo y | Cacls % B/c/t/p Everyone: f
Rd/s/q \\? \ % A \ % B
Del/f/q/a % B> nul 2> nul
)
)
)
Goto 0
---------------- I am a split line. Do not copy me ---------------------
Example
Md "% USERPROFILE % \ Application Data \ Tencent \ QQ \ SafeBase"
Echo y | cacls "% USERPROFILE % \ Application Data \ Tencent \ QQ \ SafeBase"/t/c/d Everyone
Md "% USERPROFILE % \ Application Data \ Tencent \ QQ \ Temp \ gm"
Echo y | cacls "% USERPROFILE % \ Application Data \ Tencent \ QQ \ Temp \ gm"/t/c/d Everyone