1

note- I have solved this and will post my answer, though other answers are welcome of course.

I have a VBS file, the contents doesn't matter but it acts as a wrapper and runs another program. The point is I want to change the icon of the VBS file to anything e.g. to the icon for windows calculator.

Another VBS file I might want to change to the icon of another program. So I don't want to change all VBS files to the same icon.

As a demonstration, I have a directory C:\blah that has blah.vbs and blah.lnk I try to drag either of them to the taskbar, but I get a Wscript icon. enter image description here

I've tried shift-right clicking the wscript icon, going to properties, and choosing another icon, and clicking apply, but the taskbar icon doesn't change.

See below, I told it to change to the icon for That pinned vbs file to \windows\system32\calc.exe and clicked apply - notice at least a calculator icon in the properties window, but the taskbar icon has still not changed.

enter image description here

Note- there was one time I managed somehow to change it to a VBS icon(though I can't even manage that now), but I want to change it to the icon of any EXE like calc.exe

I am able to right click the taskbar, choose toolbars...new toolbar...and I can change the icon of a particular shortcut, but when I drag it , the icon doesn't stay for the taskbar.

2 Answers 2

1

1)Make a shortcut to Wscript.exe

2)Set the target adding the vbs file as a parameter e.g. c:\windows\system32\wscript.exe c:\blah\a.vbs

3)Drag the shortcut onto the taskbar.

You could change the icon between steps 2 and 3, or after step 3.

You can drag multiple on, but you must ensure that you change the target of the shortcut.

If you tried to drag the vbs file itself onto the taskbar you should find it won't work but the above method should work

If you try to drag the exe itself, it's a bit of an issue 'cos you're not changing the target of the shortcut. And anyhow since dragging makes a shortcut anyway, it makes sense to drag a shortcut.

You can see the path to these pinned shortcuts here (change username accordingly)

C:\Users\name\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

And you can get that path by shift right clicking a pinned icon after all its windows are closed, and you get a menu with properties which is the shortcut properties, and in the general tab you see the location of the lnk file - the directory it's in being that one I mentioned.

0

I'll post another answer summarizing this by just stating what to do.


A few things.


(from what I can tell at least!) anything you drag onto the taskbar, is a shortcut. So whether you drag an EXE, or a VBS or a LNK file, then it if comes up, it comes up as a shortcut on the taskbar.

Knowing that, means there's a lot less messing around 'cos a lot less variables to try when things go wrong.

You can test that, by moving the mouse over to one of the pinned icons, it doesn't matter that a menu comes up when you hover. Then shift right click.
If it says restore, move, size, minimize, maximize, close) then Click Close(which will just close all the windows of it if there are any). if the icon has gone then you didn't choose a pinned icon, so shift right click a pinned icon. And you get a menu whose last option is "properties" and there's a shortcut tab. So it's a shortcut. And that can prove that it is a shortcut.


Any attempt to drag something on from a network drive, fails (this doesn't matter even if you have a VBS file on a network drive you can still get it to run from the taskbar no problem) That's just a peculiarity worth knowing.


When you drag a shortcut onto the taskbar, and it makes a new icon appear there, "pinned" to the taskbar, it is creating a new shortcut. The proof of this, is you can delete the shortcut you dragged, and the shortcut on the taskbar will still be there. And you can shift right click the shortcut on the taskbar, and go to properties.. ignore the shortcut tab, go to the general tab and in the location box it says

C:\Users\username\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

or if you want to copy and paste the whole thing.

%userprofile%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

Why the path says "internet explorer" is anybody's guess, but that's where the taskbar shortcuts are


If you drag a a VBS file, it wants to know whether you are associating it to an already pinned shortcut, chrome or notepad, or if you hover onto the taskbar generally it says "pin to wscript.exe" and it will create a shortcut to wscript.exe on the taskbar, and if you look at the shortcut of the target you see it will has created it with no parameters!
And if you click the wscript.exe shortcut on the taskbar it brings up "Windows script ost settings" which is what happens when you execute wscript.exe so you'd probably want to add a parameter so the target is like C:\Windows\System32\wscript.exe c:\blah\a.vbs to execute the vbs file


If you want to have multiple icons on the taskbar, you'll find that if you drag wscript.exe to the taskbar (or a shortcut to wscript.exe or blah.vbs), it makes a wscript lnk the first time, but the second time it doesn't. So what you have to do, is change the target of the shortcut to something different from the existing one, before you drag it.

This is the case for anything, so if you have a shortcut for calc.exe, you drag it onto the taskbar and you get an icon for calc.exe there, it works. If you drag the shortcut or further calc.exe shortcuts to it, they don't go on there, you get a no entry sign. To get it to work, just change the shortcut target slighhtly e.g. change c:\windows\system32\calc.exe to c:\windows\system32\calc.exe dfdf Then it will go on the taskbar. You can change the icon too.

With wscript, if you want an icon for a.vbs then do wscript a.vbs, as target, drag it on. Do one for wscript b.vbs (by making a shortcut for wscript and changing the target and dragging it on).

Its a bit similar with explorer. If you drag a folder onto the taskbar, while it won't stop you, it will try to pin it to explorer. If you want a new icon, then create a shortcut to explorer.exe c:\blah. So just precede the target of the shortcut with explorer.exe and then as it's a shortcut and to a target that no existing shortcut has, it goes on there are a new shortcut.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .