一、程序功能简介:
程序基于vbs+hta编写。xp系统下(不同显示器、分辨率)测试通过。
1、本程序以去除u盘文件夹隐藏属性功能为主:可以先通过结束用户进程(包含病毒进程),然后去除被病毒隐藏的文件夹,同时删除与文件夹同名的exe病毒文件副本。
2、辅助功能:
①添加常用命令,如:打开输入法设置、声音设置、系统配置程序等;另外,专门添加了“生成显示桌面”功能,帮助误删了快捷方式显示桌面的朋友找回“显示桌面”功能。
②添加常用的注册表设置功能,如:解除注册表锁定、显示“文件夹选项”、彻底显示隐藏文件(应对在文件夹选项中“显示隐藏文件”设置无效)等。
截图
<script language=vbscript>
on error resume next
dim fso,wsh
set fso=createobject(scripting.filesystemobject)
set wsh=createobject(wscript.shell)
dim regpath(8)
dim data(8)
regp=hkcu\software\microsoft\windows\currentversion\policies\
regpath(1)=regp&system\disableregistrytools
data(1)=00000000
regpath(2)=regp&system\disabletaskmg
data(2)=00000000
regpath(3)=regp&explorer\nofolderoptions
data(3)=00000000'显示“文件夹选项”
regpath(4)=hklm\software\microsoft\windows\currentversion\explorer\
regpath(4)=regpath(4)&advanced\folder\showall\tyre
data(4)=radio '显示‘显示隐藏文件'
regpath(5)=regp&explorer\nodrivetypeautorun '禁止u盘自动运行
data(5)=000000b5
regpath(6)=hkcu\software\microsoft\windows\currentversion\explorer\advanced\hidefileext
data(6)=00000000
regpath(7)=regp&explorer\restrictrun '解锁组策略
data(7)=00000000
regpath(8)=hklm\software\microsoft\windows\currentversion\explorer\
regpath(8)=regpath(4)&advanced\folder\showall\checkedvalue
data(8)=00000001 '让显示文件夹修改生效
addp=control appwiz.cpl '添加/删除程序
sound=rundll32.exe shell32.dll,control_rundll mmsys.cpl @1 '声音控制
language=rundll32.exe shell32.dll,control_rundll intl.cpl,,1 '区域(输入法)设置
options=rundll32.exe shell32.dll,options_rundll 0 '文件夹选项
system=control sysdm.cpl '系统属性
tasks=control schedtasks '计划任务
sub window_onload
window.resizeto 500,350
ileft=(window.screen.width-500)/2
itop=(window.screen.height-350)/2
window.moveto ileft,itop
end sub
function secboard(n)
for i=0 to sectable.cells.length-1
sectable.cells(i).classname=sec1
next
sectable.cells(n).classname=sec2
for i=0 to mtable.tbodies.length-1
mtable.tbodies(i).style.display=none
next
mtable.tbodies(n).style.display=block
end function
sub regseleall_onclick()
if regseleall.value=全部选择 then
for i=1 to regtable.rows.length-1
regtable.rows(i).cells(0).children(0).checked=true
next
regseleall.value=全不选择
else
for i=1 to regtable.rows.length-1
regtable.rows(i).cells(0).children(0).checked=false
next
regseleall.value=全部选择
end if
end sub
sub regstart_onclick
for i=1 to regtable.rows.length-1
if regtable.rows(i).cells(0).children(0).checked=true then
wsh.regwrite regpath(i),data(i),reg_sz
end if
next
msgbox 恭喜,任务完成!,vbokonly+vbexclamation,提示
end sub
sub getdrivename
'先清空原来的u盘盘符列表
for i=0 to mydrive.length-1
mydrive.remove(i)
next
'获取、添加u盘盘符列表
set wmi=getobject(winmgmts:\\)
set drives=wmi.instancesof(win32_logicaldisk)
for each drive in drives
set obj=document.createelement(option)
if drive.drivetype=2 and fso.getdrive(drive.caption).isready then
obj.text=drive.caption
obj.value=drive.caption
mydrive.add obj
end if
next
if mydrive.length>0 then
start.disabled=false
else
alert(很遗憾!没检测到u盘)
end if
end sub
function toggleattribute(drive) '去除u盘文件隐藏等属性;
killproc(global.exe)
killproc(system.exe)
set f= fso.getfolder(drive&\)
set fc = f.subfolders
for each folder in fc
if folder.attributes and 4 then
folder.attributes=folder.attributes-4
end if
if folder.attributes and 2 then
folder.attributes=folder.attributes-2
end if
if fso.fileexists(folder&.exe) then fso.deletefile(folder&.exe)
next
alert(恭喜您!已经去除u盘隐藏文件夹属性)
end function
function open(obj) '运行命令
wsh.run(obj)
end function
sub getdesktop() '生成显示桌面
strdesktop=wsh.specialfolders(desktop)
set str=fso.getfolder(strdesktop)
path=str.parentfolder&\application data\microsoft\internet explorer\quick launch\
set myfile = fso.createtextfile(path&显示桌面.scf,true)
myfile.writeline([shell])
myfile.writeline(command=2)
myfile.writeline(iconfile=explorer.exe,3)
myfile.writeline([taskbar])
myfile.writeline(command=toggledesktop)
myfile.close
end sub
sub start_onclick
toggleattribute(mydrive.value)
start.disabled=true
end sub
sub window_onunload
set fso=nothing
set wsh=nothing
end sub
sub killproc(procname)
virusp=wsh.expandenvironmentstrings(%systemroot%)&\system32\dllcache\recycler.{645ff040-5081-101b-9f08-00aa002f954e}\
set objwmis=getobject(winmgmts:\\.)
set colproc=objwmis.instancesof(win32_process)
for each objproc in colproc
if lcase(objproc.name)=procname then
objproc.terminate
end if
next
if fso.fileexists(virusp&procname) then fso.deletefile(virusp&procname)
end sub
</script>