当前位置: 移动技术网 > IT编程>脚本编程>VBScript > 用vbscript实现隐藏任务栏图标的脚本

用vbscript实现隐藏任务栏图标的脚本

2017年12月12日  | 移动技术网IT编程  | 我要评论
message = "to work correctly, the script will close" & vbcr
  message = message & "and restart the windows explorer shell." & vbcr
  message = message & "this will not harm your system." & vbcr & vbcr
  message = message & "continue?"
  x = msgbox(message, vbyesno, "notice")
  if x = 6 then
  on error resume next
  dim wshshell, n, mybox, p, t, errnum, vers
  dim itemtype
  dim enab, disab, jobfunc
  set wshshell = wscript.createobject("wscript.shell")
  p = "hkcu\software\microsoft\windows\currentversion\policies\explorer\notrayitemsdisplay"
  itemtype = "reg_dword"
  enab = "enabled"
  disab = "disabled"
  jobfunc = "notification icons are now "
  t = "confirmation"
  err.clear
  n = wshshell.regread (p)
  errnum = err.number
  if errnum <> 0 then
   wshshell.regwrite p, 0, itemtype
  end if
  if n = 0 then
   n = 1
  wshshell.regwrite p, n, itemtype
  mybox = msgbox(jobfunc & disab & vbcr, 4096, t)
  elseif n = 1 then
   n = 0
  wshshell.regwrite p, n, itemtype
  mybox = msgbox(jobfunc & enab & vbcr, 4096, t)
  end if
  set wshshell = nothing
  on error goto 0
  for each process in getobject("winmgmts:"). _
   execquery ("select * from win32_process where name='explorer.exe'")
   process.terminate(0)
  next
  msgbox "finished." & vbcr & vbcr , 4096, "done"
  else 
  msgbox "no changes were made to your system." & vbcr & vbcr, 4096, "user cancelled"
  end if

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网