[SOLVED] script to automate toolbar creation Win 10

jknow

Distinguished
Jun 30, 2012
7
0
18,510
Hello all, I work for a end user servicing IT company. (super simple stuff for the most part.)
I've been writing up a batch file to automate some of the things I do with every computer clean.
However I've been unable to find a solution to my current problem.

I'm looking to automate creation of a task bar toolbar in Win10
from what I've heard usually automation is done via powershell or vbscripts. since i'm fairly certain this cannot be done
with cmd/batch files. (however if I can do it with a script, i should be able to call the script within my batch file.)

Does anyone know how you would do this via one of those methods?

Thanks!
 
Solution
Would the paths for the registry be the same on win 7 and 10?
Sorry, but I wouldn't have a clue as I don't have any Win 7 systems installed to look at. It might be done completely different on Win 7.

I thought the tenforums.com site had a batch file showing how to import the registry also. It doesn't so I'll give you two quick examples below.

First up is the code to Export the toolbar from the original machine.
Code:
@echo off
REG EXPORT HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop "%userprofile%\Desktop\My_Taskbar-Toolbars_Backup.reg" /Y
pause

And here's an example batch file to import the toolbar to other machines:
Code:
@echo off
reg import My_Taskbar-Toolbars_Backup.reg
taskkill /f /im...

jknow

Distinguished
Jun 30, 2012
7
0
18,510
Neither, i'm talking about creating a toolbar on the taskbar.

In windows 10 the action is as follows with the GUI

Right click taskbar > Toolbars>new toolbar>navigate to folder>select Folder

the functionality I use it for is just to put a text toolbar with the phone number for the IT company I work for so people can call us back if there are other issues.

I would simply like to automate the process via script.
 
Last edited:

gardenman

Splendid
Moderator
Those toolbars are stored in the registry, and in binary format which makes it difficult to add to a batch file (there may be a way, but I haven't looked that up).

One way of doing what you want, is to set up the toolbars that you want on one machine, export the registry key, then import the registry key on other machines. You then have to log off/on or restart Explorer before changes will be updated. This will only work if the paths are the same on each PC.

The registry key is located here:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop

Here is two batch files. One to export the registry from a machine once you create the toolbars, and another to import the registry on other machines (assuming all paths will be the same on all machines).
https://www.tenforums.com/tutorials/67665-backup-restore-taskbar-toolbars-windows-10-a.html
Then in your batch file, you will also want to restart Windows Explorer to make the changes show up. Use taskkill and start to restart Explorer.exe.
 

jknow

Distinguished
Jun 30, 2012
7
0
18,510
Thank you! I think that's as close as i'm gonna get to what I'm wanting to do.
One more question Would the paths for the registry be the same on win 7 and 10?
 

gardenman

Splendid
Moderator
Would the paths for the registry be the same on win 7 and 10?
Sorry, but I wouldn't have a clue as I don't have any Win 7 systems installed to look at. It might be done completely different on Win 7.

I thought the tenforums.com site had a batch file showing how to import the registry also. It doesn't so I'll give you two quick examples below.

First up is the code to Export the toolbar from the original machine.
Code:
@echo off
REG EXPORT HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop "%userprofile%\Desktop\My_Taskbar-Toolbars_Backup.reg" /Y
pause

And here's an example batch file to import the toolbar to other machines:
Code:
@echo off
reg import My_Taskbar-Toolbars_Backup.reg
taskkill /f /im explorer.exe
start explorer.exe
pause

And obviously you have to take the My_Taskbar-Toolbars_Backup.reg file along with you to new machines.

I've tested both of the above batch files and they do work on my Windows 10 test system.
 
Solution

TRENDING THREADS