Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to add a desktop icon via registry?

2,079 views
Skip to first unread message

justaguy

unread,
Nov 27, 2013, 12:08:44 PM11/27/13
to
Hi,

I assume that info about all the desktop icons are stored in the registry and if this assumption is true I wonder how we could add a desktop icon via registry.

Many thanks.

Stanley Daniel de Liver

unread,
Nov 27, 2013, 12:21:32 PM11/27/13
to
no, icons can be separate files (or, more likely) embedded in a windows
executable.
Back c. 2003 I recall there were programs that would "extract" icons from
an exe, for delivery by SMS packages

I believe you can set a Desktop Item to point to an icon from within the
registry, but you'd have to locate that icon (file) 1st.

--
It's a money /life balance.

justaguy

unread,
Nov 27, 2013, 12:57:36 PM11/27/13
to
Ok, too bad, thanks for your input.

frank.w...@gmail.com

unread,
Nov 27, 2013, 2:16:57 PM11/27/13
to
From justaguy :
>I assume that info about all the desktop icons are
>stored in the registry and if this assumption is true I
>wonder how we could add a desktop icon via registry.

I don't know what you mean by "info about all the
desktop icons", but what Mr Stanley wrote is correct.
The files are in the directory
"\users\%username%\Desktop" of your system drive.

The icons for special folders (Recycle bin, Computer,
etc.) are placed on the Desktop according to values in
the Registry -- perhaps this is what you meant. These
can be added, changed, and removed through the Registry.

Frank

justaguy

unread,
Nov 27, 2013, 2:36:14 PM11/27/13
to
Thank you, Frank, for your additional info. The very reason that I'm exploring another option of adding a desktop icon to a computer for my software installer is that the current installer previously did add a desktop icon for XP and Windows 7 but recently users complained it does not though it did for my Windows 7.

Frank Westlake

unread,
Nov 27, 2013, 4:43:03 PM11/27/13
to
2013-11-27 11:36, justaguy:
> The very reason that I'm exploring another option of adding a desktop icon to a computer for my software installer is that the current installer previously did add a desktop icon for XP and Windows 7 but recently users complained it does not though it did for my Windows 7.

Please don't leave all the previous post in your message just out of
laziness; leave only what is necessary to clarify your reply.

One of the things some installers do is to create shortcuts to the
application on the desktop. A program can create a shortcut through the
Windows API. If the installer is creating desktop shortcuts in only some
Windows operating systems it might be because of the path changed and
the installer hasn't accounted for that. I don't know when the desktop
path changed, nor where it's various locations have been, but other
people here do know that -- maybe someone will tell you. But that
problem is probably something to address to the installer manufacturer.

Frank


big_jon...@lycos.co.uk

unread,
Nov 27, 2013, 6:56:07 PM11/27/13
to
You have been asking the same questions in this same group at regular intervals for more than four years now. Please take a look at the questions you asked when called Don84 and now justaguy and read the responses before asking the same thing again, it's rude.

Frank Westlake

unread,
Nov 27, 2013, 7:26:23 PM11/27/13
to
2013-11-27 15:56, big_jon...@lycos.co.uk:
> You have been asking the same questions in this same group at regular intervals for more than four years now. Please take a look at the questions you asked when called Don84 and now justaguy and read the responses before asking the same thing again, it's rude.

I think Don84 was this guy: <http://knowledgenotebook.com/>. If so, I don't mind helping a little. I think he's trying to keep from telling us too
much because then we would just hand him a solution and he would have to credit us in the project. I don't mind that much either, but things do add up.

Frank

justaguy

unread,
Nov 27, 2013, 8:49:43 PM11/27/13
to
Thank you for all your help, Frank. The software program evolved... and its installer needs to catch up as well...

The last leg of the installer has a block of code like the following for adding a desktop icon to the user's computer:
REM prior, addDesktopIconKN.cmd has been copied to %userProfile%\Downloads\
call "%userProfile%\Downloads\addDesktopIconKN.cmd" FF
REM if the above call fails try the following
call "C:\Program Files\KnowledgeNoteBook\addDesktopIconKN.cmd" FF
goto kickoffFF

REM launch Firefox browser with a URL
:kickOffFF
...

EXECUTION OUTCOME:
the kickOffFF block was executed and
the line of call "C:\Program Files\KnowledgeNoteBook\addDesktopIconKN.cmd" FF
was executed for my Windows 7 as well.
Also, prior to installation, KnowledgeNoteBook subdirectory does not exist for
the "C:\Program Files" directory nor does the addDesktopIconKN.cmd file.
But KnowledgeNoteBook contains the addDesktopIconKN.cmd file.
And the KnowledgeNoteBook subdirectory is created/added to "C:\Program Files\"
during installation extraction process.

Now, question, is there any way to determine if the following is called successfully? If so I'd like to write its outcome to a log file for debugging.
call "C:\Program Files\KnowledgeNoteBook\addDesktopIconKN.cmd" FF

Thank you very much.

frank.w...@gmail.com

unread,
Nov 28, 2013, 4:28:06 AM11/28/13
to
From justaguy :
>Now, question, is there any way to determine if the
>following is called successfully? If so I'd like to
>write its outcome to a log file for debugging.
>call "C:\Program Files\KnowledgeNoteBook\addDesktopIconKN.cmd" FF

If the file exists then it was called successfully. You
can determine that with

If EXIST "the whole file mame here" ...

But you can't decide afterwards that you want to save
the output -- you must always save it if it might be
needed.

If what you want is to determine whether
addDesktopIconKN.cmd succeeds or fails then have it end
with "EXIT /B 0" on success or "EXIT /B 1" on failure.
Then you can use the ERRORLEVEL in the conventional way,
or like this:

CALL addDesktopIconKN.cmd FF >save && (
REM SUCCESS, discard 'save'.
TYPE save
ERASE save
) || (
REM FAILURE, keep 'save' for debugging.
TYPE save
)

The format is

COMMAND && (SUCCESS) || (FAILURE)

'addDesktopIconKN.cmd' should be able to determine if it
succeeds by testing for the shortcut after the creation
attempt:

If EXIST "...\Desktop\KnowledgeNotebook.lnk" (EXIT /B 0) Else (EXIT /B 1)

Frank

Frank Westlake

unread,
Nov 28, 2013, 8:48:54 AM11/28/13
to
Don, when you open a message reply window first press [CTRL-A] and then [DELETE]. That will very easily get rid of all of the message you are replying
to from your reply. It is better to have nothing then to have an undecipherable mess.

Frank

justaguy

unread,
Nov 28, 2013, 9:41:56 AM11/28/13
to
THANK you for everything, Frank. Would you like to see the current product / not publicly released version (partially thanks to good work/help from good people like you)?

big_jon...@lycos.co.uk

unread,
Nov 28, 2013, 10:01:08 AM11/28/13
to
On Thursday, 28 November 2013 14:41:56 UTC, justaguy wrote:
>
> THANK you for everything, Frank. Would you like to see the current product / not publicly released version (partially thanks to good work/help from good people like you)?

It is to be hoped that this unreleased version does not breach Microsoft's copyright by distributing versions of Windows Installer and Net Framework executables.

Stanley Daniel de Liver

unread,
Nov 28, 2013, 10:04:38 AM11/28/13
to
On Wed, 27 Nov 2013 19:36:14 -0000, justaguy <do...@yahoo.com> wrote:

[]
> Thank you, Frank, for your additional info. The very reason that I'm
> exploring another option of adding a desktop icon to a computer for my
> software installer is that the current installer previously did add a
> desktop icon for XP and Windows 7 but recently users complained it does
> not though it did for my Windows 7.

it should be specified in the MSI. But it seems you're not using MS
installer.

big_jon...@lycos.co.uk

unread,
Nov 28, 2013, 10:33:14 AM11/28/13
to
On Thursday, 28 November 2013 15:04:38 UTC, Stanley Daniel de Liver wrote:
> it should be specified in the MSI. But it seems you're not using MS
>
> installer.

All they have done is packaged their product in a WinRAR SFX and all they require is a Shortcut placing on the end users Desktop upon extraction of their package.

The shortcut, .LNK, is named so as opposed to .URL because they do not wish the link to be opened in the users browser of choice, they wish it to be opened in one of these browsers in order of preference Mozilla Firefox, Google Chrome, Internet Explorer.

The shortcut will be:
Name and Description - Knowledge Notebook
Icon - "<ProgramLocation OR UserProfile>\kn12.ico", 0
Target - "<SupportedBrowser.exe>" http://127.0.0.1:8600/knb2/index.cfm.

The things which need investigating:
Why the shortcut is being placed without user say so on their Desktop and not within their Start Menu tree
Whether the extraction location to %ProgramFiles% is an installation or just an extraction. If it's just a standalone then perhaps it should be located here %ProgramFiles(x86)%, which does not exist on all supported OS's.
The Downloads directory in %UserProfile% which is being used for no explicable reason is not a default Special Folder in all OS's supported
Why.

Just bear in mind then that this product is not free, they are charging $25 for it! (http://knowledgenotebook.com/buy.html)

Frank Westlake

unread,
Nov 28, 2013, 10:49:18 AM11/28/13
to
2013-11-28 06:41, justaguy:
> Would you like to see the current product...?

No, thanks. I'm terribly busy trying to get Slackware 14.1 installed on
my laptop using EFI. Supposedly it isn't hard, but I haven't got to the
part yet where it isn't hard. Still trying.

Frank

Frank Westlake

unread,
Nov 28, 2013, 10:55:09 AM11/28/13
to
2013-11-28 07:33, big_jon...@lycos.co.uk:
> Just bear in mind then that this product is not free, they are
> charging $25 for it! (http://knowledgenotebook.com/buy.html)

Thanks for finding that, and your other cautions. I only looked to see
that I could download it without an account and that the instructions
did not say anything about payment. I consider this theft by fraud.
Theft of my services through deception that the product is free.

Frank

Stanley Daniel de Liver

unread,
Nov 28, 2013, 1:02:21 PM11/28/13
to
On Thu, 28 Nov 2013 15:33:14 -0000, <big_jon...@lycos.co.uk> wrote:

[]
>
> All they have done is packaged their product in a WinRAR SFX and all
> they require is a Shortcut placing on the end users Desktop upon
> extraction of their package.
>
> The shortcut, .LNK, is named so as opposed to .URL because they do not
> wish the link to be opened in the users browser of choice, they wish it
> to be opened in one of these browsers in order of preference Mozilla
> Firefox, Google Chrome, Internet Explorer.

http://ss64.com/nt/shortcut.html

Do people no longer do some rudimentary FWSEing first?

> The shortcut will be:
> Name and Description - Knowledge Notebook
> Icon - "<ProgramLocation OR UserProfile>\kn12.ico", 0
> Target - "<SupportedBrowser.exe>" http://127.0.0.1:8600/knb2/index.cfm.
>
[]

>
> Just bear in mind then that this product is not free, they are charging
> $25 for it! (http://knowledgenotebook.com/buy.html)

and a bit late in delivery if he's asked the same question 4 years ago!

frank.w...@gmail.com

unread,
Nov 28, 2013, 4:49:09 PM11/28/13
to
From Frank Westlake :
>I'm terribly busy trying to get Slackware
>14.1 installed on my laptop using EFI.
>Supposedly it isn't hard, but I haven't got
>to the part yet where it isn't hard. Still
>trying.

Got it! It is easy, but I had made a bootable USB-stick with the Slackware 14.0 in my virtual machine, then I copied the contents of the Slackware 14.1 ISO file to the Slackware 14.0 bootable USB-stick. When I installed Slackware onto a swapped-out hard drive I was trying to apply the 14.1 EFI procedures to the 14.0 non-EFI kernel. After I re-made the USB-stick with 14.1 the setup program handled all the EFI mess for me. Now to get WIFI working....

During the process I learned that Windows 8 will mount
an ISO file as a local CD-ROM drive, just like it was on
a CD-ROM! No need to burn a CD, just right-click and
select "Mount". Select "Eject" when finished.

Frank

Stanley Daniel de Liver

unread,
Nov 29, 2013, 4:02:49 AM11/29/13
to
No need for daemontools then? that is progress! In Linux you can just
mount an iso.

Frank Westlake

unread,
Nov 29, 2013, 10:35:27 AM11/29/13
to
2013-11-29 01:02, Stanley Daniel de Liver:
> In Linux you can just mount an iso.

That's what got me to see if it could be done in Windows. I don't know if this is new with Windows 8 because I use very little of the system since
Windows NT 4.

OFF TOPIC, but to the group:
I got WIFI working in Slackware so I might be switching permanently to Linux. I have a second hard drive setup to boot into Linux and I've been
swapping hard drives while setting it up; after the next swap I might just keep it that way. I'll probably remain in this group and hopefully I'll
find a CMD emulator so I can continue contributing.

Frank

justaguy

unread,
Nov 29, 2013, 4:20:10 PM11/29/13
to

> Just bear in mind then that this product is not free, they are charging $25 for >it! (http://knowledgenotebook.com/buy.html)

But for you guys it's free.
Just let me know (donli at knowledgenotebook dot com).

justaguy

unread,
Nov 29, 2013, 4:21:46 PM11/29/13
to
No. No. Misunderstanding here. No where at our website did we say it's free.

Stanley Daniel de Liver

unread,
Nov 30, 2013, 8:33:06 AM11/30/13
to
You might need a virtual machine or a remote host.
I found this, but it's a comparison of linux (shell) scripting and the MSW
command line.

http://polishlinux.org/apps/cli/cmdexe-for-linux-zealots/

Andy

unread,
Dec 1, 2013, 9:22:08 PM12/1/13
to
The easiest way is to make your own icon.

64 x 64 pixels is a good size.

You can do a print screen of what you would like, and then resize it.

Irfanview can convert any picture file format to an .ico.

Andy
0 new messages