This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Creating shortcut to folder
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2011
07:12 AM
Creating shortcut to folder
I want to create a shortcut to a folder that gets installed. I've searched and done what was suggested but still no shortcut.
I have a directory named "Reports" in TARGETDIR.
I want to create a shortcut to "Reports" in a folder named "MyApp" on the desktop.
This is what I tried. It creates a shortcut, but the shortcut is a file type shortcut and not a folder shortcut.
szFolder = TARGETDIR ^ "Reports";
LongPathToQuote(szFolder,TRUE);
AddFolderIcon(
FOLDER_DESKTOP ^ "MyApp",
"Reports Shortcut",
szFolder,
"",
"",
0,
"",
NULL);
I have a directory named "Reports" in TARGETDIR.
I want to create a shortcut to "Reports" in a folder named "MyApp" on the desktop.
This is what I tried. It creates a shortcut, but the shortcut is a file type shortcut and not a folder shortcut.
szFolder = TARGETDIR ^ "Reports";
LongPathToQuote(szFolder,TRUE);
AddFolderIcon(
FOLDER_DESKTOP ^ "MyApp",
"Reports Shortcut",
szFolder,
"",
"",
0,
"",
NULL);
(6) Replies
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2011
09:20 AM
Remove "MyApp" from your code:
AddFolderIcon(
FOLDER_DESKTOP,
"Reports Shortcut",
szFolder,
"",
"",
0,
"",
NULL);
AddFolderIcon(
FOLDER_DESKTOP,
"Reports Shortcut",
szFolder,
"",
"",
0,
"",
NULL);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2011
10:40 AM
How will that put the shortcut in a desktop folder?
In my install I need to create a folder named "MyApp" on the desktop. Inside this folder I want a shortcut to another folder named "Reports".
In my install I need to create a folder named "MyApp" on the desktop. Inside this folder I want a shortcut to another folder named "Reports".
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 06, 2011
12:40 PM
szProgramFolder = FOLDER_DESKTOP ^ "MyApp";
szCommandLine = TARGETDIR^"Reports";
szItemName = "Reports Shortcut";
szWorkingDir = TARGETDIR^"Reports";
szIconPath = WINDIR^"system32\\SHELL32.dll";
nIcon = 4;
szShortCutKey = "";
nFlag = REPLACE|RUN_MAXIMIZED; //can be anything according to your wish
nResult = AddFolderIcon (szProgramFolder, szItemName, szCommandLine,
szWorkingDir, szIconPath, nIcon,
szShortCutKey, nFlag);
I avoided LongPathToQuote(szFolder,TRUE) and it still worked.Try with that too...
Hope this helps...
szCommandLine = TARGETDIR^"Reports";
szItemName = "Reports Shortcut";
szWorkingDir = TARGETDIR^"Reports";
szIconPath = WINDIR^"system32\\SHELL32.dll";
nIcon = 4;
szShortCutKey = "";
nFlag = REPLACE|RUN_MAXIMIZED; //can be anything according to your wish
nResult = AddFolderIcon (szProgramFolder, szItemName, szCommandLine,
szWorkingDir, szIconPath, nIcon,
szShortCutKey, nFlag);
I avoided LongPathToQuote(szFolder,TRUE) and it still worked.Try with that too...
Hope this helps...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 12, 2011
11:39 PM
Have you resolved the issue?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 13, 2011
07:45 AM
No it has not. It creates a shortcut and it looks like a folder shortcut, but when I double-click it is actually looking for a program. When I go to the Properties of the shortcut the Target Type is still 'File'.
Is I manually create a shortcut to that folder, the Target Type is 'File folder'.
Is I manually create a shortcut to that folder, the Target Type is 'File folder'.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 14, 2011
12:24 AM
I will surely look further into this issue. Initial tests were working on my side. That was the reason for me posting the snippet.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)