Solved

Desktop Shortcuts

Posted on 1997-04-30
10
747 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
ID: 1397036
Edited text of question
0
 

Author Comment

by:missle
ID: 1397037
Edited text of question
0
 
LVL 1

Expert Comment

by:advapp
ID: 1397038
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
ID: 1397039
Also, what environment do you expect to implement the solution in?  VC++, VB, C?
0
 

Author Comment

by:missle
ID: 1397040
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:advapp
ID: 1397041
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
ID: 1397042
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
ID: 1397043
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
ID: 1397044
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
ID: 1397045
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
knowledge extraction for DB and VBA 6 74
Changing the installation path of this MSI 5 93
Explain Unit of Work pattern 2 54
Visual Studio: built-in keystroke automation 2 46
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

947 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

23 Experts available now in Live!

Get 1:1 Help Now