Solved

Desktop Shortcuts

Posted on 1997-04-30
10
739 Views
Last Modified: 2013-12-03
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
0
Comment
Question by:missle
  • 6
  • 4
10 Comments
 

Author Comment

by:missle
Comment Utility
Edited text of question
0
 

Author Comment

by:missle
Comment Utility
Edited text of question
0
 
LVL 1

Expert Comment

by:advapp
Comment Utility
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
 
LVL 1

Expert Comment

by:advapp
Comment Utility
Also, what environment do you expect to implement the solution in?  VC++, VB, C?
0
 

Author Comment

by:missle
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:advapp
Comment Utility
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
 
LVL 1

Accepted Solution

by:
advapp earned 100 total points
Comment Utility
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
 
LVL 1

Expert Comment

by:advapp
Comment Utility
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
 

Author Comment

by:missle
Comment Utility
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
 
LVL 1

Expert Comment

by:advapp
Comment Utility
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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now