dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
14320
Scilicet (banned)
Spaced Out
join:2005-04-11
Aurora, CO

Scilicet (banned)

Member

[WIN7] Can you change the icon on individual .cmd files?

A friend asked me to set up some individual desktop files to open specific webpages in a browser. She wanted 6 different icons for 6 different webpages. So I set up 6 different .cmd files on her desktop as so:

start firefox.exe http...webpage

I don't think it is possible in Win7, but does anyone know if can I assign a different icon to each of the 6 .cmd files on her desktop? I suppose that I could write a few java programs to open the browser or maybe some html files with specific icons specified, but it's way too much trouble. Is there a simple solution? Thanks for any input.

Hall
MVM
join:2000-04-28
Germantown, OH

Hall

MVM

What about locating the various .cmd files in a directory somewhere and then make shortcuts on the desktop to these ? I think you can change icons on shortcuts...
dave
Premium Member
join:2000-05-04
not in ohio

dave to Scilicet

Premium Member

to Scilicet
I don't know, but is there some reason why you're using a .cmd file rather than just a simple shortcut to the web page?

Easy approach: open the web page in the browser, then drag the icon from the address bar to the desktop. Change icon as required.

This will open the web page in the default browser, which may or may not be what you need.

Freddy
Premium Member
join:2005-05-17
Arlington, VA

Freddy to Scilicet

Premium Member

to Scilicet
Also, one of these shortcuts methods may work:

»support.microsoft.com/kb/140443

Just put the address to the website in the shortcut, as specified. You can find icons in Windows or on the Internet. Just Google for icons.

Freddy
Scilicet (banned)
Spaced Out
join:2005-04-11
Aurora, CO

Scilicet (banned) to dave

Member

to dave
Changing the icon to one .cmd file changes it for all .cmd files. Apparently, Win7 wants to insure that a hacker can't replace a desktop program to a cmd file with a false icon. Nice idea.

Dragging the icon from the address bar will save that webpage as a html file to something like C:\\..... to where ever you specify on your HD. Tried that.

No she wants to open only one active page address to, say, her bank and another to her email, etc. I have set her default home pages separated by | so that all her webpages open in separate tabs in the browser. She also wants separate desktop files to open each webpage individually. The cmd file works well that way, but the system will supply the cmd file icon shown with gears to all files with a .cmd extension.

I just thought that someone here might have found a simple solution without hacking the system or writing programs.
Scilicet

Scilicet (banned) to Freddy

Member

to Freddy
Thanks Freddy, but those methods work for program files and not .cmd files.

Kramer
Mod
join:2000-08-03
Richmond, VA

Kramer to Scilicet

Mod

to Scilicet
Not sure I understand your problem. What you describe is not rocket science and is done thousands of times a day. As Dave said most people do what you want to do by creating shortcuts. If dragging the URL to the desktop doesn't work for you, simply right click a blank spot on the desktop and left click "new" and then shortcut. Either manually enter or paste the web site address into the location field. Assign an icon and that icon is unique to that shortcut. That's probably the most common method for doing what you want.

You have added one twist. You are insisting Firefox open up the web site, and if Firefox isn't your default browser, then the shortcut to a URL will not work quite the way you want. In that case, your method is fine, but don't place the command files on the desktop, place shortcuts to those command files instead. The icons for those are totally adjustable and you can use anything you want.

In the attached graphic, I have two shortcuts to CMD files and one URL shortcut which normally would be the icon for my default browser (Chrome), but was easily changed.
LLigetfa
join:2006-05-15
Fort Frances, ON

LLigetfa to Scilicet

Member

to Scilicet
I still don't understand why CMD files would be needed. Shortcuts work fine and there is no need to make a shortcut to a CMD file either.

If and when I need to use a CMD file, I create a LNK to it so that I can start it minimized and not get that ugly black window flash up.

workablob
join:2004-06-09
Houston, TX

workablob to Scilicet

Member

to Scilicet
said by Scilicet:

A friend asked me to set up some individual desktop files to open specific webpages in a browser. She wanted 6 different icons for 6 different webpages. So I set up 6 different .cmd files on her desktop as so:

start firefox.exe http...webpage

I don't think it is possible in Win7, but does anyone know if can I assign a different icon to each of the 6 .cmd files on her desktop? I suppose that I could write a few java programs to open the browser or maybe some html files with specific icons specified, but it's way too much trouble. Is there a simple solution? Thanks for any input.

Login as administrator
Paste this code into a text file.
Rename from .txt to .vbs
Place in System32 or somewhere else if you like.
Copy file
Paste shortcut on desktop
Right-Click and select properties.
Click Change Icon

'BEGIN CODE
Option Explicit

Dim wshShell
Set wshShell = CreateObject ("wscript.shell")

wshShell.CurrentDirectory = "c:\program files\internet explorer"

wshShell.Run "iexplore.exe mysite.com", 1, vbFalse

Set wshShell = nothing

'END CODE
Scilicet (banned)
Spaced Out
join:2005-04-11
Aurora, CO

Scilicet (banned) to Kramer

Member

to Kramer
Yes, that works. Thanks Kramer. No, it's not rocket science, but can be a bit confusing if you've never had a need for it before.
OZO
Premium Member
join:2003-01-17

1 recommendation

OZO to LLigetfa

Premium Member

to LLigetfa
said by LLigetfa:

I still don't understand why CMD files would be needed. Shortcuts work fine and there is no need to make a shortcut to a CMD file either.

If and when I need to use a CMD file, I create a LNK to it so that I can start it minimized and not get that ugly black window flash up.

There could be many, many different reasons, why one wants to do that. Here is just one example. If I want to run browser with dynamic profile (to guarantee my privacy protection) I may want to create (copy) profile in temporary place, launch the browser, pointing to that profile, use it as needed, close the browser and then BAT file will remove that temporary profile folder. Here you can find example of BAT file, doing exactly that. And BTW, you can easily hide that "ugly black window flash up" if you want too. Linked page mentions utility (CMDH), that will help you to do that
dave
Premium Member
join:2000-05-04
not in ohio

1 edit

dave to Scilicet

Premium Member

to Scilicet
said by Scilicet:

Apparently, Win7 wants to insure that a hacker can't replace a desktop program to a cmd file with a false icon. Nice idea.

I don't think so. I think it's just that there is no place to store the icon except in cmd.exe. If you change the icon for an .exe file, for a shortcut, etc., the icon is stored in that file. A cmd file is plain text. Where's the icon going to go?

And in fact if I put a .cmd file on the desktop, there's no place to even attempt to change the icon for it (right-click, properties yields no such option). Whereas if I make a shortcut to that same .cmd file, the icon can be changed on the 'shortcut' tab of the property sheet. So I wonder how you're attempting to change the icon?

Dragging the icon from the address bar will save that webpage as a html file to something like C:\\..... to where ever you specify on your HD. Tried that.

Works for me, I've been using it for practically ever. And if I look at the 'properties' of the shortcut, the URL field has precisely the URL of the actual web page.

I just thought that someone here might have found a simple solution without hacking the system or writing programs.

Really, the drag icon-to-desktop is that simple solution on all the Win7 systems I use. We must be using different methodologies, but I can't see how.

Freddy
Premium Member
join:2005-05-17
Arlington, VA

Freddy to Scilicet

Premium Member

to Scilicet
Thanks Freddy, but those methods work for program files and not .cmd files.

What I referenced to is the same thing as what Kramer told you regarding using a shortcut to a web page. Easy.

Freddy
Scilicet (banned)
Spaced Out
join:2005-04-11
Aurora, CO

Scilicet (banned)

Member

Yes, and I thank you both for the help. It was easy once the proper procedure was described and that was exactly what I was looking for. Thanks again.
OZO
Premium Member
join:2003-01-17

OZO to dave

Premium Member

to dave
said by dave:

said by Scilicet:

Apparently, Win7 wants to insure that a hacker can't replace a desktop program to a cmd file with a false icon. Nice idea.

I don't think so. I think it's just that there is no place to store the icon except in cmd.exe. If you change the icon for an .exe file, for a shortcut, etc., the icon is stored in that file. A cmd file is plain text. Where's the icon going to go?

It all depends on developer's willingness to support the feature. If they wanted to implement it, they know, that there is the easy way. They could add ADS to .cmd/.bat files as they do it for e.g. .url files. Example of such ADS: :favicon:$DATA 1078. But they've decided, that we don't need it. Instead they think that we need aero and transparency more, than that basic functionality... :( If I were working on that functionality, I'd implement it the same way as for other type of files. But who cares there, what we customer need or ask for...
dave
Premium Member
join:2000-05-04
not in ohio

dave

Premium Member

Sure, it's software, any anything can be done. But I was talking about how things actually are, not how they could be if they were different.

(Though thanks for the info that .url files store it in a named stream; I thought it was actually in the unnamed stream)

I suggest that rather than having "decided you don't need it", it's more likely that hardly anyone's actually asked for it.

Anyway, there's a trivial workaround: use a shortcut to the batch file; put the batch file not-on-your-desktop and the shortcut on your desktop. Problem solved.