Autorun Virus Immune batch processing cacls

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.