Peter Smick

Manipulating Windows 10 Taskbar

1 post in this topic

#1 ·  Posted (edited)

I am deploying Windows 10 to a number of workstations in a domain and I am looking for a script that will install and configure the QuickLaunch Toolbar to the Windows taskbar.   I am very close:  with a borrowed script that will install the QuickLaunch toolbar and turn off text and titles, but the toolbar installs on the right end of the taskbar (just to the left of notifications area) which I don't want.   I can't figure out how to move the QL Toolbar over to the left end of the taskbar.  Here is the code I am using:

#NoTrayIcon
#RequireAdmin

Dim $strToolbarFolder, $oPosition, $AddRemove

$strAddRemove = $CmdLine[1]
$strToolBarFolder = "%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch"

; Disable user input from the mouse and keyboard
;BlockInput(1)
Sleep(500)
ControlFocus("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]")

; Right click on the taskbar
$oPosition = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]")
;MsgBox (1,"oPosition[2] and [3]", "oPosition[2] = " & $oPosition[2] & " and oPosition[3] = " & $oPosition[3])
ControlFocus("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]")
ControlClick("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]", "secondary", 1, $oPosition[2], $oPosition[3])

; Sleep and send T to select the Toolbar and N for "New toolbar..."
;PGS:   sending Q below will remove the QL toolbar currently in the default profile, but
;       if that toolbar is removed from the profile first, then do NOT send the Q or script wioll error
Send("T")
Send("{RIGHT}")
Sleep(500)
If $strAddRemove="A" Then
      Send("N")
      Sleep(500)
      ; Wait for the "New Toolbar - Choose a folder" window
      If Not WinWaitActive("New Toolbar - Choose a folder", "", 3) Then
      Exit 1
      EndIf

      ; Lower send delays to speed up typing
      Opt("SendKeyDelay", 1)
      Opt("SendKeyDownDelay", 1)

      ; Type the name of the folder for the new toolbar
      Send($strToolbarFolder)

      ; Set send delays to default values again
      Opt("SendKeyDelay", 5)
      Opt("SendKeyDownDelay", 5)

      ; Go to the folder and select the "Select Folder" button
      Send("{ENTER}")
      Sleep(500)
      Send("{Tab}{ENTER}")

      ;Turn off text and titles for QL Toolbar
      ControlFocus("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]")
      $oPosition = ControlGetPos("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]")
      ;MsgBox (1,"oPosition(2) and (3)", "oPosition(2) = " & $oPosition[2] & " and oPosition(3) = " & $oPosition[3])

      ControlFocus("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]")
      ;MsgBox (0,"oPosition(2) and (3)", "oPosition(2) = " & $oPosition[2] & " and oPosition(3) = " & $oPosition[3])
      ControlClick("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]", "secondary", 1, $oPosition[2], $oPosition[3])
      ;ControlClick("[CLASS:Shell_TrayWnd]", "", "", "secondary", 1, $oPosition[2], $oPosition[3])

      Send("x")
      Sleep(200)
      ControlClick("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ReBarWindow321]", "secondary", 1, $oPosition[2], $oPosition[3])
      Send("w")
      Send("{ENTER}")
      Sleep(200)
Else
    Send("Q")
    Sleep(500)
EndIf

; Enable user input from the mouse and keyboard
BlockInput(0)

Exit 0

 

Can anyone give me some insight about how to finish this up?

 

Thanks,

Peter

Edited by Peter Smick

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now