Prohibit running the specified program with a batch implementation _dos/bat

Source: Internet
Author: User
Tags goto
Function:
1. Prohibit running the specified program
2. Lifting the prohibition of the designation of procedures
3. View all prohibited Programs
Copy Code code as follows:

@echo off
MODE Con cols=40 lines=18
Title prohibits and unlocks the specified program--Chen Bing oo:286569692
: Begin
Setlocal enabledelayedexpansion
Cls
Echo.
Echo. ╭─────────╮
Echo. ╭───┤ Select the following operations ├───╮
Echo. │╰─────────╯│
Echo. ││
Echo. │a. Add a program to be blocked │
Echo. ││
Echo. │b. To remove a program that has been blocked │
Echo. ││
Echo. │c. See all prohibited Programs │
Echo. ││
Echo. │z. Exit Program │
Echo. ││
Echo. ╰─────────────────╯
Echo.
Copy%systemdrive%\windows\jzcx%systemdrive%\windows\jzcx.txt>nul
set/p enter= Please enter your choice:
If not "%enter%" = "" Set enter=%enter:~0,1%
if/i "%enter%" = = "A" goto Jinzhiadd
if/i "%enter%" = = "B" goto Jinzhidel
if/i "%enter%" = = "C" goto Jinzhick
if/i "%enter%" = = "Z" goto exit
Goto BEGIN
: Jinzhiadd
Cls
Echo.
Echo.
Echo. Enter the program to be blocked: press Y to return to the menu
Echo.
set/p input=
if/i "%input%" = = "Y" goto begin
Echo%input%>>%systemdrive%\windows\jzcx.txt
REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution options\%input%"/V debugger/t reg_sz/d debugfile.exe/f
Echo.
Echo. Successfully added a program to be blocked%input%
Echo.
Echo. Any key, return other actions
Copy%systemdrive%\windows\jzcx.txt%systemdrive%\windows\jzcx>nul
Pause>nul
Goto BEGIN
: Jinzhidel
Cls
Echo.
Echo.
Echo.
Echo.
Echo. The procedures for all prohibitions are as follows:
Echo-------------------------------
Echo.
Type%systemdrive%\windows\jzcx.txt
Echo.
Echo-------------------------------
Echo.
Echo. Enter the banned program to remove: Press Y to return to the menu
Echo.
set/p jinzhidel=
if/i "%jinzhidel%" = = "Y" goto begin
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution options\%jinzhidel%"/F
@for/F "tokens=* delims="%%i in (' findstr/i/v/c:%jinzhidel%%systemdrive%\windows\jzcx.txt ') does (
Set var=%%i
Echo!var!>>temp.txt
)
Copy Temp.txt%systemdrive%\windows\jzcx.txt>nul
Del Temp.txt
Cls
Echo.
Echo.
Echo.
Echo.
Echo. Operation complete
Echo.
Echo.
Echo. Any key, return other actions
Copy%systemdrive%\windows\jzcx.txt%systemdrive%\windows\jzcx>nul
Pause>nul
Goto BEGIN
: Jinzhick
Cls
Echo.
Echo. The procedures for all prohibitions are as follows:
Echo--------------------------------
Echo.
Type%systemdrive%\windows\jzcx.txt
Echo.
Echo--------------------------------
Echo.
Echo. Any key returns other actions
Pause>nul
Goto BEGIN

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.