# WinXP programming question

**URL:** https://boards.straightdope.com/t/winxp-programming-question/517932
**Category:** Factual Questions
**Created:** [November 17, 2009, 5:36pm UTC](https://boards.straightdope.com/t/winxp-programming-question/517932 "2009-11-17T17:36:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![VunderBob](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@VunderBob](https://boards.straightdope.com/u/VunderBob)
#### Post date: [November 17, 2009, 5:36pm UTC](https://boards.straightdope.com/t/winxp-programming-question/517932/1 "2009-11-17T17:36:43Z")

</div>

I did RTFM, and could not find anything to do what I want.

Is there a set of WIN32 programming functions that would create a file shortcut?

I’m working on a configuration utility to run at boot time, and I need to put some non-existant shortcuts into the system startup folder. THis is supposed to work automagically, so manual creation (the only way I know to do it right now) is not an option. I looked through the file functions and saw nothing; looking for explicit shortcut routines turned nothing up, either.

Once the shortcuts exist, I have a good grasp on how to use the file functions to get them where they need to be.

---

<div class="post-metadata">

### Author: ![Gus\_Gusterson](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@Gus\_Gusterson](https://boards.straightdope.com/u/Gus_Gusterson)
#### Post date: [November 17, 2009, 6:01pm UTC](https://boards.straightdope.com/t/winxp-programming-question/517932/2 "2009-11-17T18:01:09Z")

</div>

Look for CreateLink in the Shell API.

---

<div class="post-metadata">

### Author: ![Gus\_Gusterson](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@Gus\_Gusterson](https://boards.straightdope.com/u/Gus_Gusterson)
#### Post date: [November 17, 2009, 6:06pm UTC](https://boards.straightdope.com/t/winxp-programming-question/517932/3 "2009-11-17T18:06:57Z")

</div>

It just occurred to me that CreateLink isn’t actually a function in the API. I’m just so used to calling it that I started thinking of it as being part of the API.

Here’s an example from CodeGuru that should get you started: [http://www.codeguru.com/cpp/w-p/files/shellapifunctions/article.php/c7209/](http://www.codeguru.com/cpp/w-p/files/shellapifunctions/article.php/c7209/)

---

<div class="post-metadata">

### Author: ![CaveMike](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cavemike/32/16379_2.png) [@CaveMike](https://boards.straightdope.com/u/CaveMike)
#### Post date: [November 17, 2009, 6:36pm UTC](https://boards.straightdope.com/t/winxp-programming-question/517932/4 "2009-11-17T18:36:16Z")

</div>

**Gus** has the correct answer. But you might find the example [here](http://msdn.microsoft.com/en-us/library/bb776891(VS.85).aspx) easier to use since it is not tied to the dialog.

---

<div class="post-metadata">

### Author: ![VunderBob](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@VunderBob](https://boards.straightdope.com/u/VunderBob)
#### Post date: [November 18, 2009, 6:32pm UTC](https://boards.straightdope.com/t/winxp-programming-question/517932/5 "2009-11-18T18:32:01Z")

</div>

> [@CaveMike](#):
>
> **Gus** has the correct answer. But you might find the example [here](http://msdn.microsoft.com/en-us/library/bb776891(VS.85).aspx) easier to use since it is not tied to the dialog.

**Cave** , I actually used code from your example over **Gus** ’, because your’s wasn’t tied to a dialog box (simplicity). It took a little twiddling but I got it to create a shortcut to Sol.Exe, and placed it in the startup directory like I wanted. Now I have to edit my program to change all the innocuous and experimental manipulations to the ones I really need to make happen.

I’m satisfied it works, and a big thank you to both of you for helping me out.
