0

My task here is to pin two shortcuts to the taskbar by batch script.

I have a script adapted from here, creating two shortcuts in %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\, and it works well. Unfortunately my taskbar doesn't notice them being created and therefore doesn't show them.

How do I tell the taskbar to update itself, adding those shortcuts?

It's about Win10 PCs.

Edit: I tried it with pinnerjs.bat, it seems there is a strange problem: Its contextmenu doesn't see the same items as my contextmenu. Made pictures to illustrate. The item I need executed is "An Taskleiste anheften", the one directly below "Edit with Notepad++".

I can live with using pinnerjs if we get it to work, but I'd prefer a more direct solution (telling the taskbar to add the shortcuts in its folder).

Edit 2: Tried changing the pinnerJS script from saying "taskbar" to the german "taskleiste" - didn't work.

My context menu

Output showing pinners context menu

Community
  • 1
  • 1
Squirrelkiller
  • 2,575
  • 1
  • 22
  • 41
  • Can you at least tell me how this is still too broad? I'm asking about a specific problem, with possibly a specific solution, ideally being a single line of code. – Squirrelkiller Apr 12 '17 at 08:24

1 Answers1

1

Try with pinnerjs.bat :

call pinnerjs.bat C:\Windows\System32\cmd.exe taskbar

Not sure how it will work with shortcut. Probably it will be better to directly pin the executable.

npocmaka
  • 55,367
  • 18
  • 148
  • 187
  • Doesn't work. It says `pinning firefox.exe to taskbar`, but firefox isn't added to the taskbar, and in the %APPDATA%... folder there isn't a shortcut either. If possible, I'd like a direct solution better anyway, since I'd acutally learn something. Tried to read through pinnerJS, didn't really see what's happening. – Squirrelkiller Apr 06 '17 at 12:49
  • @MarlonRegenhardt - pinning mechanism differs among the windows versions. I'll be able to check it on windows 10 later today. pinnerjs uses windows script host and automates the right click to an icon and searches for a 'taskbar' verb. If your language settings are not in english it could fail. – npocmaka Apr 06 '17 at 13:10
  • Language setting is german, so it's probably that. Do you think you could give me a code example by using the essential code from pinner, without actually using pinnerjs.bat? Would certainly help me adapt it to german. – Squirrelkiller Apr 07 '17 at 07:12