智慧旅游建设:让CIH永不发作--批处理命令

来源:百度文库 编辑:神马品牌网 时间:2024/05/04 12:44:53

根据病毒的两个弱点进行编程:
1,只在特定日期发作
2,只在进入Windows之后发作
因此我们可以在Autoexec.bat中设置一段小程序,在进入Windows之前提醒用户更改日期。 详细步骤:
(一)用记事本打开或新建Autoexec.bat,输入以下内容:
rem *****CIH&25CIH***** 此行为注释不被执行
type nul>c:\today.is 建立一个0 字节空的临时文件todoy.is
cls 清除屏幕显示
dir c:\today.is|find "-26-" 查找开机时间是否为26日
if not errorlevel 1 goto CIH 如果没有错误是26日就执行
:CIH 子程序
goto noCIH 否则不是26日则转到:noCIH子程序
:CIH :是子程序的标志,CIH是子程序名称
echo Today is CIH day!Please change clock to 27th in the CMOS! 是26日就在屏幕上显示英文“今天是CIH 日请在CMOS中更改日期为27日”
pause 暂停程序运行,并显示英文“Press any key countinue”(按任意键继续)
del c:\today.is>nul 删除today.is(nul为不显示删除过程中的提示)
restart.com 执行restart.com,此文件可以到Win98启动盘中的Ebd.cab 中提取,提取后把它放到C:\下面
:noCIH 不是26日时执行该子程序.以下预防圣诞CIH的方法与上面的类似不再说明
cls
dir c:\today.is|find "12-25-"
if not errorlevel 1 goto 25vir
goto novir
:25vir
echo Today is CIH day!Please change clock to 27th in the CMOS!
pause
del c:\today.is>nul
restart.com
:novir
del c:\today.is>nul
rem *****CIH&25CIH*****
cls
使用:
当你在每月的26日或12月25日打开电脑时,屏幕就会出现英文提示“Today is CIH day!Please change clock to 27th in the CMOS!”