Questions tagged [lnk]

Use this tag for questions about Windows .lnk files representing Shortcuts (or Shell Links). For questions about link errors after compilation (of for example C/C++ code) use the tag [linker-error]

Use this tag if your question is about working with the .lnk (Shell Links) files from a programming perspective.

This can include:

  • the creation of such .lnk files,
  • the required registry keys,
  • its installation by means of a setupprogram,
  • its binary format
  • the relation with IShellLink

Notice that in Unix variants those files are sometimes called .Desktop files.

Wikipedia reference

128 questions
2
votes
0 answers

C++ Can't Convert Type *const to Type *&

I have been stuck trying to find a solution to an error message I have been getting when trying to pass in a private object pointer from WordTree into a recursive array inside my << overload function. Header: struct WordNode { unsigned int…
J. Willus
  • 537
  • 1
  • 5
  • 15
2
votes
2 answers

Create Shortcut in StartUp folder (VB.NET)

I have this code and it's giving troubles: Imports IWshRuntimeLibrary Imports Shell32 Public Sub CreateShortcutInStartUp(ByVal Descrip As String) Dim WshShell As WshShell = New WshShell() Dim ShortcutPath As String =…
soulblazer
  • 1,178
  • 7
  • 20
  • 30
2
votes
1 answer

Create Short Cut to EXE without path

I need to create a short cut to internet explorer - iexplore.exe - passing it a URL. This is for an internal product that will only function in IE. Normally I could just specify the "c:\program files\internet explorer\iexplore.exe"…
Roger Pray
  • 51
  • 4
2
votes
2 answers

How can I find the destination of a .lnk file in vb.net

I made a explorer.exe clone, with a treeview and a listview etc. Now I need to handle clicking a .lnk file, so I need the destination path of a .lnk file..
Dee
  • 67
  • 1
  • 4
2
votes
0 answers

How to get path to .ico file from .lnk

Possible Duplicate: Extract Icon from Windows .lnk (shortcut) file For example, I have a Shortcut (.LNK) file that has C:\Foo\bar.ico as it's icon. How can I get the path of the icon (C:\Foo\bar.ico) when supplied with just the shortcut file in…
chyyran
  • 2,446
  • 2
  • 21
  • 35
1
vote
1 answer

Is there a way to resolve a .lnk target that works for links that end up in c:\windows\installer?

The usual way to resolve lnk involve using WShell.WshShortcut or IShellLink that way : var WshShell = WScript.CreateObject("WScript.Shell"); var oShellLink = WshShell.CreateShortcut(strDesktop +…
Emmanuel Caradec
  • 2,302
  • 1
  • 19
  • 38
1
vote
1 answer

Creating a Windows shortcut (shell link) in C++

I want to programmatically create a Windows shortcut (.lnk file) to a folder. To do this, I tried this code snippet. However, I get the compilation error C2371 'WebBrowser': redefinition; different basic types in C:\Program Files (x86)\Windows…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
1
vote
0 answers

C# trying to getshortcuttargetfile to parse lnk file

I'm trying to build a simple archiving program. We have files scattered throughout the system so part of the routine checks to see if a shortcut was put into the system and if so, to fetch all of the files from where the shortcut points to. It was…
Nathan Mc
  • 21
  • 7
1
vote
3 answers

how do you set the icon of a shortcut through a batch file?

I'm trying to create a script that will create shortcuts of the target batch files and set the icon to a .ico or .dll icon file: @echo off @echo Writing CreateShortcut script @echo Set oWS = WScript.CreateObject("WScript.Shell") >>…
1
vote
0 answers

C# - Get the executable path from a Office Windows 10 .lnk file

I'm trying to get the exe path from the Windows 10 Office .lnk file. e.g. Link Path - C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk Exe Path - C:\Program Files\Microsoft Office\Office16\WINWORD.EXE Things I've tried: Shell shell…
Sandwich
  • 356
  • 7
  • 18
1
vote
3 answers

C++, good old LNK1169 (and LNK2005) errors

I have 4 files, 2 headers and 2 cpp files. Header file one: #ifndef complex_2 #define complex_2 #include #include using namespace std; namespace comp { class complex{ protected: double re, im; public: …
Ryuu
  • 596
  • 1
  • 5
  • 26
1
vote
2 answers

Replace all autocad shortcuts found on system ussing Batch?

I need to replace every icon (AutoCAD 2010.LNK) found on the computer with another .LNK using batch. The icon\ shortcut as we well know can be found anywhere and as many times as the user likes. How can I achieve this?
Meldrum
  • 57
  • 2
  • 7
1
vote
2 answers

ShellLink returning an old location

In a C# program I want to be able to identify the file locations of LNK files (the actual file location, not the LNK location). But sometimes ShellLink is returning an old location for a file. For instance it is returning "C:\Program Files…
Mick Bruno
  • 1,373
  • 15
  • 13
1
vote
2 answers

c++ LNK2001: unresolved external symbol problem

Greetings. I have searched for a solution, but I think this problem is personal code specific, hence my posting here. I'll get straight to the point. In my main I have two objects. Computer *computer = new Computer(); Player *player = new…
Joey Roosing
  • 2,145
  • 5
  • 25
  • 42
1
vote
1 answer

c++ visual studio LNK1104 cannot open file MSVCURTD.lib

Hi I am working on a visual studio c++ project started on visual studio 2012, I have to adjust this project and add new functionalities, my problem is that when I try to build I get the following ERROR "LNK1104 cannot open file MSVCURTD.lib". Could…
Ale61268967
  • 107
  • 2
  • 10
1 2
3
8 9