用vbscript实现隐藏任务栏图标的脚本
用vbscript实现隐藏任务栏图标的脚本
发布时间:2016-12-28 来源:查字典编辑
摘要:Message="Toworkcorrectly,thescriptwillclose"&vbCRMessage=Message&"andr...

Message="Toworkcorrectly,thescriptwillclose"&vbCR

Message=Message&"andrestarttheWindowsExplorershell."&vbCR

Message=Message&"Thiswillnotharmyoursystem."&vbCR&vbCR

Message=Message&"Continue?"

X=MsgBox(Message,vbYesNo,"Notice")

IfX=6Then

OnErrorResumeNext

DimWSHShell,n,MyBox,p,t,errnum,vers

Dimitemtype

Dimenab,disab,jobfunc

SetWSHShell=WScript.CreateObject("WScript.Shell")

p="HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerNoTrayItemsDisplay"

itemtype="REG_DWORD"

enab="ENABLED"

disab="DISABLED"

jobfunc="NotificationIconsarenow"

t="Confirmation"

Err.Clear

n=WSHShell.RegRead(p)

errnum=Err.Number

iferrnum<>0then

WSHShell.RegWritep,0,itemtype

EndIf

Ifn=0Then

n=1

WSHShell.RegWritep,n,itemtype

Mybox=MsgBox(jobfunc&disab&vbCR,4096,t)

ElseIfn=1then

n=0

WSHShell.RegWritep,n,itemtype

Mybox=MsgBox(jobfunc&enab&vbCR,4096,t)

EndIf

SetWshShell=Nothing

OnErrorGoTo0

ForEachProcessinGetObject("winmgmts:")._

ExecQuery("select*fromWin32_Processwherename='explorer.exe'")

Process.terminate(0)

Next

MsgBox"Finished."&vbcr&vbcr,4096,"Done"

Else

MsgBox"Nochangesweremadetoyoursystem."&vbcr&vbcr,4096,"UserCancelled"

EndIf

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新vbs学习
热门vbs学习
脚本专栏子分类