The issue I think arises due to that shortcut not being in the links directory first. Programs
Follow this:
%AppData%\Microsoft\Windows\Start Menu\ProgramsRecently addedThis is a kludge work around that Microsoft needs to fix, but it worked for me.
Temporary rename the .bat file to .exe. Then right click on the file name. It will give you the Pin to start option. Pin it to the start menu. It won't work, but there is an option open the file location. Select that and change the name back to .bat. Now it works.
I used a .vbs to do this in the current profile (and used the registry, runonce to launch the .vbs on all (new)userprofiles). We are working with both Dutch and English devices in our company so you will see that it will try both languages. The problem is that it did not work on a .lnk but you can always create an exe referring to your desired destination.
Dim strFolder, strExecutable
Set objShell = CreateObject("Shell.Application")
strFolder = "C:\Tools"
strExecutable = "Tool.exe"
Set objFolder = objShell.Namespace(strFolder)
Set objFolderItem = objFolder.ParseName(strExecutable)
Set colVerbs = objFolderItem.Verbs
'Loop through the verbs and if PIN is found then 'DoIt' (execute)
blnOptionFound = False
For Each objVerb In colVerbs
If Replace(objVerb.name, "&", "") = "Aan het menu Start vastmaken" Then
objVerb.DoIt
blnOptionFound = True
End If
Next
For Each objVerb In colVerbs
If Replace(objVerb.name, "&", "") = "Pin to Start Menu" Then
objVerb.DoIt
blnOptionFound = True
End If
Next
Just try to create a folder (and subfolder, if necessary, for ps1, sh, cmd, bat, etc.). In this folder, you can place all your script files or shortcuts to them (as I did) and add this folder to the taskbar as you can see in the gif below:
This is my folder named :☺☻
For name: Alt+1, Alt+2
Folder for sample taskbar layout:
%HomeProfile%\☺☻\
|-------\Pin_Bash\
| |-------:
Your_Script_#1.sh
| |-------:
Your_Script_#2.sh
| |-------:
Your_Script_#3.sh
|
|-------\Pin_PS1\
| |-------:
Your_Script_#1.ps1
| |-------:
Your_Script_#2.ps1
| |-------:
Your_Script_#3.ps1
|
|-------\Pin_Cmd\
|-------:
Your_Script_#1.cmd
|-------:
Your_Script_#2.bat
|-------:
Your_Script_#3.batYou can create a second menu, or submenu, for your Script, Players, Browsers, DevSofters, Games, etc ..., adding new folders in the root menu / and easily navigate them as a custom menu:Task_Bar / Folder

