Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use batch processing to prohibit the running of specified programs

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to use batch processing to prohibit the running of specified programs. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Features:

1. Prohibit the running of specified programs

two。 Lift the prohibition of specified procedures

3. View all prohibited programs

The code is as follows:

@ echo off

MODE con COLS=40 LINES=18

Title prohibits and removes the operation of designated programs-- Chen Bing OO:286569692

: begin

Setlocal ENABLEDELAYEDEXPANSION

Cls

Echo.

Echo. ╭─╮

Echo. ╭───┤ chooses the following operation ├───╮

Echo. │ ╰─╯ │

Echo. │ │

Echo. │ A. Add the program │ to be banned

Echo. │ │

Echo. │ B. Delete the prohibited program │

Echo. │ │

Echo. │ C. View all prohibited programs │

Echo. │ │

Echo. │ Z. Exit the 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 banned: 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 the program to be banned input%

Echo.

Echo. Any key, return to 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 total prohibition are as follows:

Echo--

Echo.

Type% systemdrive%\ WINDOWS\ jzcx.txt

Echo.

Echo--

Echo.

Echo. Enter the prohibited program to delete: 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 / CMV% jinzhidel%% systemdrive%\ WINDOWS\ jzcx.txt') do (

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 completed

Echo.

Echo.

Echo. Any key, return to other actions

Copy% systemdrive%\ WINDOWS\ jzcx.txt% systemdrive%\ WINDOWS\ jzcx > nul

Pause > nul

Goto begin

: jinzhick

Cls

Echo.

Echo. The procedures for total prohibition are as follows:

Echo--

Echo.

Type% systemdrive%\ WINDOWS\ jzcx.txt

Echo.

Echo--

Echo.

Echo. Any key returns other actions

Pause > nul

Goto begin

This is the end of this article on "how to use batch processing to prohibit the running of specified programs". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report