当前位置: 首页 > 图文教程 > 脚本技术 > VBScript > 用vbscript实现隐藏任务栏图标的脚本

VBScript
vbs删除注册表项的代码
用vbs检查注册表项的访问权限的代码
vbs之使用Internet Explorer 屏蔽密码
vbscript 注册表脚本书写
vbs下通过日期查找文件夹的代码
vbs复制文件的脚本
vbs实现计算机重启
文件备份vbs脚本
vbs下用一个小方法实现批量添加域用户
用vbs实现本地添加用户的脚本
vbs AD日志开启脚本nableKerbLog的脚本
vbs实现压缩文件夹的脚本
用VBS修改远程桌面3389端口并添加到Windows防火墙的代码
用vbs实现自动检查代理是否可用,并自动设置IE代理的脚本
vbs实现的定时关机、重启的脚本和程序
vbs实现的定时提醒你休息的脚本
vbs自动填表单分析附源码
vbs实现的汉字转拼音的函数
初窥WMI_Vbs脚本编程简明教程补充读物
用vbs实现判断计算机是笔记本还是台式机的代码

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-11   浏览: 83 ::
收藏到网摘: n/a

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