Desktop Shortcuts

We (Rockwell) have created a new version of a previously existing application,which we also created.  The problem that this new version is in a new location on the client's hard drive.  

I wondering if there is a way to check if a user has placed a shortcut of the old App on his/her desktop.  If they have I would like to make it point to the new App, or delete it and put a new one in its place.

I has been suggested that "A shortcut on the desktop is mearly a .LNK file in the c:\windows\dektop directory. Open each of the .LNK files in that directory and check to see if they point to your program. "

The problem with that is. What if the computer has mutilple users logging in.  For example, I login under two different names on our network depending upon what task I want to perform.  The reason is that one of my logins has access that the other doesn't.  Anyway, on my computer in c:\windows\desktop it shows the Desktop of the the default login, not the Desktop of either of my two logins.  I think It must be done threw windows api, but I just don't know the commands.  


Thanks
missleAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

missleAuthor Commented:
Edited text of question
0
missleAuthor Commented:
Edited text of question
0
advappCommented:
Is this for WinNT4?  Win95?  Both?

Under both WinNT4, each user has their own profile.  This will also be true under Win95 IF the option has been set to use this capability.

I think I can help you through this but I need a little more info on the platforms you expect to live on.
0
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

advappCommented:
Also, what environment do you expect to implement the solution in?  VC++, VB, C?
0
missleAuthor Commented:
This is for Windows 95, I would like to assume that the feature allowing mutiple users is checked.


I was going to implement the solution in Visual Basic.

Thanks
0
advappCommented:
You may have misunderstood one statement I made.  Under Win95, you can always have multiple users login and each will get their own password.  However, there are options which can be set to determine whether all users use the same settings or use different preferences and desktop settings.  Plus, options are available to include/exclude: Network Neighborhood settings, desktop icons, start menu entries, and program groups.

So, I don't believe you can assume that a Win95 workstation is set to use any or all of these options.  Although you can _determine_ which of the options is being used.

Anyway, I'll do some checking and get back to you.

0
advappCommented:
Ok, here's one approach.  It is not necessarily elegant but I'm confident that it will work.

On Win95 you can locate all *.LNK in and under:
   $Windir\Start Menu
   $Windir\Profiles

On NT, search for all *.LNK in and under:
%SystemRoot%\Profiles

Any shortcut created by a user will be found in either of these folders or their children.  Once you've located all the shortcuts, you can narrow it down to only those which point to the app in question.  Prompt the user (or not) to change them and you're done.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
advappCommented:
After re-thinking this, there is also the possibility the user has manually created a short-cut somewhere else for who knows why.  If you desired to catch them (though you could probably ignore these) you would need to search the entire disk space.
0
missleAuthor Commented:
Isn't there a way to  communicate with the windows shell using

DDEExecute and DDEchannel

to get this done?  There must be.  I can use these commands to add, edit, and delete things to the start menu; why not the desktop.  For example

DDEExecute DDEchannel, "[CreateGroup .. ]"

creates a new group to the start menu, and

DDEExecute DDEchannel, "[AddItem

adds an item.

thanks,
missle
0
advappCommented:
DDE works via Program Manager.  There are a couple of issues:  1) if the user does not use Program Manager, they may have removed it (I know many who have), 2) Program Manager will only know about the things created within it.  It only knows about groups and items created from within itself.  It does not contain a complete, matching set of program groups or items for all start menu short-cut items.  Yes, you can use DDE to ReplaceItems but only the ones of which Program Manager is aware.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.