Use Vbscript to hide the taskbar icon

Source: Internet
Author: User

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
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‑'shangher.exe '")
Process. Terminate (0)
Next
Msgbox "finished." & vbcr, 4096, "done"
Else
Msgbox "no changes were made to your system." & vbcr, 4096, "user cancelled"
End if

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.