|
bootp
初级用户
 
积分 66
发帖 25
注册 2006-11-26
状态 离线
|
 『楼 主』:
自编的小工具:增加系统中.bat、.cmd和.reg文件的安全性
使用 LLM 解释/回答一下
::===========================================================================
@ECHO OFF
ECHO intAnswer = Msgbox("本软件把.BAT、.CMD、.REG三种文件的默认打开方式由原来的“运行”重新设定为“查看”。这样,文件无意中被双击也不再直接执行,可以有效地避免误操作,增强系统的安全性。", vbExclamation , "文件安全性增强工具:批处理BAT文件、命令脚本CMD文件、注册表REG文件")>%Temp%\Temp.vbs
%Temp%\Temp.vbs
ECHO REGEDIT4 >TEMP.TXT
ECHO. >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="编辑(&E)" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="编辑(&E)" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="edit" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="编辑(&E)" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="notepad.exe \"%%1\"" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO "NullFile"="" >>TEMP.TXT
regedit /S TEMP.TXT
DEL TEMP.TXT
ECHO intAnswer = Msgbox("设定成功!批处理BAT文件、命令脚本CMD文件、注册表REG文件的默认打开方式已由原来的“运行”重新设定为“查看”。请点击“确定”退出。", vbExclamation , "文件安全性增强工具运行完成!")>%Temp%\Temp.vbs
%Temp%\Temp.vbs
DEL %Temp%\Temp.vbs
::===========================================================================
::
::如何恢复系统原来的设置? 以下代码保存为BAT文件导入系统就OK了。
::
::卸载程序:
::
::@ECHO OFF
::ECHO REGEDIT4 >TEMP.TXT
::ECHO. >>TEMP.TXT
::ECHO >>TEMP.TXT
::ECHO @="" >>TEMP.TXT
::ECHO >>TEMP.TXT
::ECHO @="" >>TEMP.TXT
::ECHO >>TEMP.TXT
::ECHO @="open" >>TEMP.TXT
::ECHO >>TEMP.TXT
::regedit /S TEMP.TXT
::DEL TEMP.TXT
::
::===========================================================================
:: 增加系统中.bat、.cmd和.reg文件的安全性
::
::
::适用于:Windows98/WindowsMe/WindowsNT/Windows2000/WindowsXP操作系统。
::
::
::
:: Windows98、WindowsMe、Windows NT、Windows2000、WindowsXP是大家都
::在使用的操作系统,在这些操作系统中,有三类文件,操作不慎容易引起系统
::异常或者出错,这三类文件是:MS-DOS 命令批处理文件、WINOWS NT命令脚本
::文件和注册表文件,扩展名分别是.bat、.cmd和.reg。这三类文件容错性较差
::的原因是,这三类文件系统的默认打开方式是运行,就是说,不小心双击了这
::些文件,文件就直接运行了。而运行这三类文件很容易造成注册表破坏或系统
::异常。
::
:: 为解决这个问题,柔人编了个东西,用来对这三个文件进行加固。加固的
::原理是,上面的三类文件都是文本文件,把默认打开方式改为查看,就是说,
::双击时这些文件将不再直接执行,而是被写字板打开共查看编辑。而这些文件
::的“运行”或“导入”,需要点击右键快捷菜单中的相应选项后才开始执行。
::
:: 这样,再也不怕不小心出现失误双击到这三类危险文件了,系统的稳定性
::和容错性就得到了加强。
::
::
::===========================================================================
::
:: 赠人玫瑰,手留余香。如果您觉得满意,别忘记给您的朋友也发送一份。
::柔人衷心地希望,能帮您和您的朋友增加一份使用电脑的乐趣,减少一点使用
::电脑的烦恼。
::
:: 欢迎使用,请保持代码完整。联系柔人:bootp@126.com
::
::=====================================EOF===================================
Last edited by bootp on 2006-12-1 at 08:36 PM ]
```
::===========================================================================
@ECHO OFF
ECHO intAnswer = Msgbox("This software resets the default opening method of .BAT, .CMD, and .REG files from the original 'Run' to 'View'. In this way, files won't be directly executed when accidentally double-clicked, which can effectively avoid misoperations and enhance system security.", vbExclamation, "File Security Enhancement Tool: Batch BAT Files, Command Script CMD Files, Registry REG Files")>%Temp%\Temp.vbs
%Temp%\Temp.vbs
ECHO REGEDIT4 >TEMP.TXT
ECHO. >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="Edit(&E)" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="Edit(&E)" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="edit" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="Edit(&E)" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO @="notepad.exe \"%%1\"" >>TEMP.TXT
ECHO >>TEMP.TXT
ECHO "NullFile"="" >>TEMP.TXT
regedit /S TEMP.TXT
DEL TEMP.TXT
ECHO intAnswer = Msgbox("Settings successful! The default opening method of batch BAT files, command script CMD files, and registry REG files has been reset from the original 'Run' to 'View'. Please click 'OK' to exit.", vbExclamation, "File Security Enhancement Tool Execution Completed!")>%Temp%\Temp.vbs
%Temp%\Temp.vbs
DEL %Temp%\Temp.vbs
::===========================================================================
::
::How to restore the original system settings? Just save the following code as a BAT file and import it into the system.
::
::Uninstall program:
::
::@ECHO OFF
::ECHO REGEDIT4 >TEMP.TXT
::ECHO. >>TEMP.TXT
::ECHO >>TEMP.TXT
::ECHO @="" >>TEMP.TXT
::ECHO >>TEMP.TXT
::ECHO @="" >>TEMP.TXT
::ECHO >>TEMP.TXT
::ECHO @="open" >>TEMP.TXT
::ECHO >>TEMP.TXT
::regedit /S TEMP.TXT
::DEL TEMP.TXT
::
::===========================================================================
:: Increase the security of.bat,.cmd, and.reg files in the system
::
::
::Applicable to: Windows98/WindowsMe/WindowsNT/Windows2000/WindowsXP operating systems.
::
::
::
:: Windows98, WindowsMe, Windows NT, Windows2000, and WindowsXP are operating systems that everyone is using. Among these operating systems, there are three types of files that are prone to system exceptions or errors if not operated carefully. These three types of files are: MS-DOS command batch files, WINDOWS NT command script files, and registry files, with extensions.bat,.cmd, and.reg respectively. The reason why these three types of files have poor fault tolerance is that the default opening method of these three types of files in the system is Run, that is, if these files are accidentally double-clicked, the files will be directly executed. And executing these three types of files is very likely to cause registry damage or system exceptions.
::
:: To solve this problem, Rouren made something to strengthen these three files. The principle of reinforcement is that the above three types of files are all text files. Change the default opening method to View, that is, when double-clicked, these files will not be directly executed but opened by Notepad for viewing and editing. And the "Run" or "Import" of these files needs to be started by clicking the corresponding option in the right-click shortcut menu.
::
:: In this way, you don't have to worry about accidentally double-clicking these three types of dangerous files anymore, and the stability and fault tolerance of the system are enhanced.
::
::
::===========================================================================
::
:: Giving roses, leaving fragrance. If you are satisfied, don't forget to send a copy to your friends.
::Rouren sincerely hopes to help you and your friends increase a bit of fun in using the computer and reduce a bit of trouble in using the computer.
::
:: Welcome to use, please keep the code complete. Contact Rouren: bootp@126.com
::
::=====================================EOF===================================
```
此帖被 +5 点积分 点击查看详情 评分人:【 redtek 】 | 分数: +3 | 时间:2006-11-30 12:47 | 评分人:【 heicai 】 | 分数: +2 | 时间:2007-3-17 05:19 |
|
附件
1: FileSafe.bat.rar (2006-12-2 09:35, 1.47 KiB, 下载附件所需积分 1 点
,下载次数: 47)
附件
2: FileSafe.exe.rar (2006-12-2 09:35, 60.89 KiB, 下载附件所需积分 1 点
,下载次数: 50)
|
|
2006-11-30 12:35 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
前面那么多没用的东西,哎
There are so many useless things before, hey
|
|
2006-12-1 07:52 |
|
|
weihua1983
初级用户
 
积分 20
发帖 10
注册 2006-10-19
状态 离线
|
|
2006-12-1 08:13 |
|
|
6622186
高级用户
   
积分 894
发帖 411
注册 2007-2-17
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
可直接用reg修改注册表, 而不必用 .reg 文件, 这样不必产生临时文件.
You can directly modify the registry using reg without using .reg files, so that temporary files are not generated.
|

@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul
|
|
2007-3-14 03:25 |
|
|
6622186
高级用户
   
积分 894
发帖 411
注册 2007-2-17
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
原来 regeidt 导入的文件不一定非要 .reg 文件, txt 文件也可以. .reg 文件只是用来双击 .reg 文件, 或在运行窗口和命令行输入文件名. regedit 命令不必受扩展名的限制.
It turns out that the files imported by regeidt don't have to be only .reg files; text files can also be used. The .reg file is just for double - clicking the .reg file or entering the file name in the Run window and command line. The regedit command isn't restricted by the file extension.
|

@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul
|
|
2007-3-14 03:49 |
|
|
yangcg
新手上路

积分 4
发帖 2
注册 2007-3-11
状态 离线
|
|
2007-3-16 12:54 |
|
|
htysm
高级用户
   
积分 866
发帖 415
注册 2005-12-4
状态 离线
|
|
2007-3-17 04:44 |
|
|
heicai
中级用户
  
积分 385
发帖 156
注册 2007-1-19
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by 6622186 at 2007-3-13 02:49 PM:
原来 regeidt 导入的文件不一定非要 .reg 文件, txt 文件也可以. .reg 文件只是用来双击 .reg 文件, 或在运行窗口和命令行输入文件名. regedit 命令不必受扩展名的限制.
又学到了这些。谢谢
Originally posted by 6622186 at 2007-3-13 02:49 PM:
It turns out that the file imported by regeidt doesn't have to be a .reg file; a txt file can also work. The .reg file is just for double-clicking the .reg file or entering the file name in the Run window and command line. The regedit command is not restricted by the file extension.
Learned these things again. Thanks
|
|
2007-3-17 05:20 |
|
|
njccav
新手上路

积分 2
发帖 2
注册 2010-5-1
状态 离线
|
|
2010-9-7 20:37 |
|
|
liangshenda
新手上路

积分 8
发帖 6
注册 2006-2-4
状态 离线
|
|
2010-12-25 00:50 |
|
|
acaigg
初级用户
 
积分 115
发帖 92
注册 2010-12-24
状态 离线
|
|
2010-12-27 19:51 |
|