Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

create windows shortcut

Posted on 2005-02-27
7
Medium Priority
?
206 Views
Last Modified: 2010-04-15
hi,
 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?
 thanks..
0
Comment
Question by:luseng
  • 3
4 Comments
 
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...
    http://www.forward.com.au/javaInstallationAids/createLnk.c.txt
    Set szLinkPath to your folder

Bye
---
Harish
0
 

Author Comment

by:luseng
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?
0
 
LVL 37

Accepted Solution

by:
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"
0
 
LVL 37

Expert Comment

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures 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.

571 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