create windows shortcut

Posted on 2005-02-27
Medium Priority
Last Modified: 2010-04-15
 i have the following link http://www.forward.com.au/javaInstallationAids/ which has the code for creating shortcut on desktop.. is it possible to create shortcut on where i want?
Question by:luseng
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 37

Expert Comment

by:Harisha M G
ID: 13414445
Hi luseng,
    You can move that link to the path where you want :)
    Here they have given the source.. where you can change the path...
    Set szLinkPath to your folder


Author Comment

ID: 13414493
Thanks for your reply..
 The code uses the following function  SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &id) which has an integer parameter(CSIDL_DESKTOP). Are there any function which gets the path(string) as a parameter?
LVL 37

Accepted Solution

Harisha M G earned 200 total points
ID: 13414549
You can remove the whole part...

    SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &id);
    SHGetPathFromIDList(id, szLinkPath);
    strcat(szLinkPath, "\\");
    strcat(szLinkPath, lpszLinkName);
    strcat(szLinkPath, ".lnk");

Is not required.
    Just use szLinkPath = "C:\YourFolder\LinkName.lnk"
LVL 37

Expert Comment

by:Harisha M G
ID: 13700185
I think my code will solve his problem :) But the author has not responded :(

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Suggested Courses

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