none
how to add desktop toolbar in the taskbar

    Question

  • hi all,

    I am deploying a windows 7 machine in which i have to add desktop toolbar in the task bar this process should be fully automated and users interaction should not be there.The deployment of the machines are done by SCCM 2007 .I know about the reg key where it is present "HKCU\Software\Microsoft\Windows\currentversion\explorer\streams\desktop" the value here is in hexa decimal form and the changes in the value cannot be judged,I also export the key as hive and load it in "HKLM\same path" but it was of no use.

    can i do this using vbscript or WAIK.

    Please provide a way.

    as this is the last task of the project & we are stuck on it.

     

    Thanks & Regards

    Pranay.

    Monday, November 28, 2011 4:43 AM

Answers

  • For this we need to create two .vbs scripts one for taking backup of the registry key and other is to restore the saved key value to the system where we want to restore the value ( in other words, where we want to enable desktop toolbar).

    Desktop toolbar value is stored in the following registry path:-

    HKCU\Software\Microsoft\Windows\currentversion\explorer\streams\desktop

    We store the value of 'TaskbarWinXP' key in a text file and use this file to restore the value.

     

    Following are the two scripts :-

         1. BackupToolbar.vbs

         2. RestoreToolbar.vbs

    Contents of BackupToolbar.vbs file:--

    Dim strComputer
    Dim objFile, objFSO
    Dim objRegistry
    Dim strKeyPath
    Dim arrValues, strValue
    Const HKEY_CURRENT_USER = &H80000001

    strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop"
    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.CreateTextFile("C:\ToolbarBackup.txt")
    Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

    objRegistry.GetBinaryValue HKEY_CURRENT_USER,strKeyPath, "TaskbarWinXP",arrValues

    For Each strValue In arrValues
          objFile.WriteLine strValue
    Next

    objFile.Close
    Set objRegistry = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing

     

    Contents of RestoreToolbar.vbs :--

    Dim strComputer
    Dim objFile, objFSO
    Dim objRegistry
    Dim strKeyPath, strValues, arrStrValues, arrValues
    Const HKEY_CURRENT_USER = &H80000001

    strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop"
    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("C:\ToolbarBackup.txt")
    Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

    strValues=objFile.ReadAll
    arrStrValues=Split(strValues, vbCrLf)
     
    ReDim arrValues(UBound(arrStrValues)-1)
    for i=0 To UBound(arrStrValues)-1
     arrValues(i)=CInt(arrStrValues(i))
    Next

    For Each Process in GetObject("winmgmts:").ExecQuery ("select * from Win32_Process where name='explorer.exe'")
     Process.Terminate(0)
    Next
     
    objRegistry.SetBinaryValue HKEY_CURRENT_USER,strKeyPath, "TaskbarWinXP",arrValues   

    objFile.Close
    Set objRegistry = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing

    Before executing 'RestoreToolbar.vbs' file,  make sure that file 'C:\ToolbarBackup.txt' is in the system in which we want to restore the backed up key value.

    For the changes to take effect we need to reboot the system.

    Hope this will solve the issue.

    Tuesday, November 29, 2011 4:40 AM

All replies

  • For this we need to create two .vbs scripts one for taking backup of the registry key and other is to restore the saved key value to the system where we want to restore the value ( in other words, where we want to enable desktop toolbar).

    Desktop toolbar value is stored in the following registry path:-

    HKCU\Software\Microsoft\Windows\currentversion\explorer\streams\desktop

    We store the value of 'TaskbarWinXP' key in a text file and use this file to restore the value.

     

    Following are the two scripts :-

         1. BackupToolbar.vbs

         2. RestoreToolbar.vbs

    Contents of BackupToolbar.vbs file:--

    Dim strComputer
    Dim objFile, objFSO
    Dim objRegistry
    Dim strKeyPath
    Dim arrValues, strValue
    Const HKEY_CURRENT_USER = &H80000001

    strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop"
    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.CreateTextFile("C:\ToolbarBackup.txt")
    Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

    objRegistry.GetBinaryValue HKEY_CURRENT_USER,strKeyPath, "TaskbarWinXP",arrValues

    For Each strValue In arrValues
          objFile.WriteLine strValue
    Next

    objFile.Close
    Set objRegistry = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing

     

    Contents of RestoreToolbar.vbs :--

    Dim strComputer
    Dim objFile, objFSO
    Dim objRegistry
    Dim strKeyPath, strValues, arrStrValues, arrValues
    Const HKEY_CURRENT_USER = &H80000001

    strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop"
    strComputer = "."

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("C:\ToolbarBackup.txt")
    Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

    strValues=objFile.ReadAll
    arrStrValues=Split(strValues, vbCrLf)
     
    ReDim arrValues(UBound(arrStrValues)-1)
    for i=0 To UBound(arrStrValues)-1
     arrValues(i)=CInt(arrStrValues(i))
    Next

    For Each Process in GetObject("winmgmts:").ExecQuery ("select * from Win32_Process where name='explorer.exe'")
     Process.Terminate(0)
    Next
     
    objRegistry.SetBinaryValue HKEY_CURRENT_USER,strKeyPath, "TaskbarWinXP",arrValues   

    objFile.Close
    Set objRegistry = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing

    Before executing 'RestoreToolbar.vbs' file,  make sure that file 'C:\ToolbarBackup.txt' is in the system in which we want to restore the backed up key value.

    For the changes to take effect we need to reboot the system.

    Hope this will solve the issue.

    Tuesday, November 29, 2011 4:40 AM
  • hi vishwajeet,

    Thanks for your reply...

    This was exactly what i was searching for....

    Thanks

    Pranay.

    Tuesday, November 29, 2011 6:14 AM
  • hi vishwajeet,

                               will u please specify how i want to change manually with out using the vb script code,bcz i am not aware of vb script but i am using dmm script which is very different but i want to first how we can change manually in xp,vista and 7.please help me vishwajeet,and also if its possible will u plz tell how u r going to add address,links,tablet pc input panel also through registry....plzzzzzzzz

                     Thanks,

                    mohan

    Thursday, November 15, 2012 3:58 AM