Archive for category pin
Pin & Unpin Icons To The Windows 7 Taskbar
During the deployment of Windows 7, I was given the task to find out a way to pin and unpin icons to the taskbar.
Well, the process is rather easy, but it takes two steps.
- Find out the verbs associated with the application you want to pin/unpin to the taskbar.
- Execute the proper verb that will pin or unpin the application.
Note: This code isn’t mine, I modified it a bit to suit my needs
1. Let’s find the verbs
Here’s the VB code that handles that:
Const CSIDL_COMMON_PROGRAMS = &H17
Const CSIDL_PROGRAMS = &H2
Set objShell = CreateObject(“Shell.Application”)
Set objScript = CreateObject( “WScript.Shell” )
REM The original code had the following line as part of it
REM Set objFolder = objShell.Namespace(“C:\Program Files\Internet Explorer”)
REM In my case, I’m pointing directly to the user path where all taskbar shortcut files are located
Set objFolder = objShell.Namespace(“C:\Users\” & objScript.ExpandEnvironmentStrings ( “%USERNAME%” ) & “\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar”)
REM I want to see a list of verbs pertaining to IE link file
Set objFolderItem = objFolder.ParseName(“Internet Explorer.lnk”)
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
Wscript.Echo objVerb
Next
You can get verbs from .exe or .lnk files.
Here’s the output for that code (the output will change based on your computer):
cscript /nologo GetVerbs.vbs
&Open
Open file locat&ion
&Enable/Disable Digital Signature Icons
Run as &administrator
Edit with &Notepad++
Scan with System Center 2012 Endpoint Protection…
Unpin from Tas&kbar
Pin to Start Men&u
Restore previous &versions
Cu&t
&Copy
Create &shortcut
&Delete
Rena&me
P&roperties
2. Let’s pin, or unpin, to the taskbar
The code that handles pinning or unpinning to the taskbar is here:
Const CSIDL_COMMON_PROGRAMS = &H17
Const CSIDL_PROGRAMS = &H2
Set objShell = CreateObject(“Shell.Application”)
Set objScriptShell = CreateObject( “WScript.Shell” )
REM Unpin Internet Explorer 64-bit from the taskbar
Set objFolder = objShell.Namespace(“C:\Users\” & objScriptShell.ExpandEnvironmentStrings ( “%USERNAME%” ) & “\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar”)
Set objFolderItem = objFolder.ParseName(“Internet Explorer (64-bit).lnk”)
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, “&”, “”) = “Unpin from Taskbar” Then objVerb.DoIt
Next
REM Pin Internet Explorer to the taskbar
Set objFolder = objShell.Namespace(“C:\Program Files (x86)\Internet Explorer”)
Set objFolderItem = objFolder.ParseName(“iexplore.exe”)
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, “&”, “”) = “Pin to Taskbar” Then objVerb.DoIt
Next
As soon as the script finishes the results are shown in the taskbar.
-
You are currently browsing the archives for the pin category.
Archives
- November 2020
- October 2020
- August 2019
- December 2018
- October 2018
- May 2018
- June 2017
- March 2017
- December 2016
- November 2016
- October 2016
- September 2016
- May 2016
- February 2016
- September 2015
- March 2015
- January 2015
- December 2014
- April 2014
- March 2014
- November 2013
- August 2013
- July 2013
- June 2013
- April 2013
- February 2013
- January 2013
- December 2012
- August 2012
- June 2012
- May 2012
- April 2012
- February 2012
- December 2011
- November 2011
- September 2011
- August 2011
- July 2011
Categories
- (WoL)
- 64-bit
- Active Directory
- administrator
- Adobe Acrobat Reader XI
- AHCI
- appdata
- Application Deployment
- asset
- asset tag
- AutoCAD
- AutoCAD Building Design Suite Premium 2015
- AutoDesk
- BDS
- BDSP
- bios
- boot process
- Browsers
- Carbonite
- Cisco
- Cisco Jabber
- command line parameters
- computer name
- Configuration manager 2012
- connection
- credentials
- definitions
- dell
- DELL OptiPlex 7050
- DELL Optiplex 7060
- DELL Optiplex 990
- DELL PowerEdge R330
- deploy
- deployment
- dfs
- disk drivers
- disks
- domain controller
- dos
- drivers
- DWG TrueView 2013
- email notifications
- email relay
- Error Code 0x80004005
- established
- esxi
- ESXi 6.5
- Exchanage 2016
- exchange
- exchange server
- favorites
- filename
- folder redirection
- folders
- geektools
- Group Policy Object
- GUID
- hidden
- hide
- HKLM
- http://schemas.google.com/blogger/2008/kind#post
- Hyper-V
- imac
- Install
- Intel C200 Chipset
- Intel Rapid Storage Technology F6
- internet
- iPhone
- JAVA
- last reboot
- latitude E6500
- links
- linux
- Local Group
- local user
- loopback processing mode
- mac
- MacIntosh
- management
- MDT 2013
- Microsoft
- Microsoft Advanced Threat Analytics
- Microsoft Advanced Threat Analytics Gateway
- Microsoft App-V client 4.6 SP1
- Microsoft Deployment Toolkit
- Microsoft System Center Configuration Manager 2012 R2 SP1
- Microsoft User State Virtualization
- ms dos
- MS Office 2010
- ms-dos 6.22
- msp
- Netdom
- netstat
- Network
- nmis
- nmis notifications
- No AutoUpdate
- office customization tool
- offline files
- Oracle
- OS
- OS Deployment
- OS X
- OST
- OST files
- outlook 2010
- Outlook 2013
- Parallels
- Parallels 10
- passwords
- patch
- Pervasive SQL v10
- pin
- port mirror
- powercli
- PowerShell
- promiscuous mode
- protected mode
- reboot
- recovery
- registry
- relay
- restore
- roaming profiles
- sccm
- SCCM 2012
- SCCM Client
- Scheduled Tasks
- script
- sendmail
- server deployment
- setup.exe
- shortcuts
- Software Center
- SSD Drives
- task sequence
- taskbar
- terminal server
- TrueView
- UDA
- Uncategorized
- Uninstall Application
- unpin
- Utilities
- vb script
- vi
- VIB
- virtual
- virtual machine
- virtual machines
- vmdk
- vmdks
- vmware
- Volume Activation
- vSwitch
- wake-on-lan
- welcome screen
- Windows 10
- windows 7
- Windows 7 Upgrade
- windows 7 x64
- windows for workgroups
- Windows Server 2008
- Windows Server 2012 R2
- Windows Server Feature
- Windows Updates
- WinPE
- wmi
- wmic
- yosemite
Recent Comments