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
1
vote
0 answers

_ITERATOR_DEBUG_LEVEL > 1 is not supported in release mode

I am using VS2015 C++ Project. Initially I had a LNK2038 issue which was error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '1' in imagecolor.obj so I added _ITERATOR_DEBUG_LEVEL=0, 1, and 2 under…
Kazu
  • 11
  • 2
1
vote
1 answer

Creating .lnk-file using only C++ and cmd

I have an .exe file and I want to add it to Autorun without using explorer. I know way to my .exe file. For adding something to Autorun I should create shortcut.lnk and put it to C:\Users\User\AppData\Roaming\Microsoft\Windows\Start…
Toxa
  • 17
  • 1
1
vote
1 answer

How to get this link to start in another folder?

I have a batch script that creates a vbs that creates a shortcut (complicated I know), however the problem is that it launches the program where the shortcut is located. Any way to make it start in C:\users\Public\Settings\ where the exe is? Thanks…
Mark Deven
  • 550
  • 1
  • 9
  • 21
1
vote
2 answers

Xgboost gpu install fatal error LNK1181

I am trying to install xgboost gpu support version by follow the follow instructions. xgboost-gpu-support I use windows 10, visual studio 2017. The not-gpu-support version works fine. But for gpu-support version,when I release mode from Visual…
Zongze Wu
  • 953
  • 1
  • 6
  • 8
1
vote
1 answer

Changing the target of multiple shortcuts with PowerShell

I am writing a PowerShell script to search the C:\Users directory and change all lnk files that contain \server1 to \server2 but keep the rest of the link. What I have so far will keep changing the LNK's target path to "Computer" and then disable…
Tom Dickson
  • 136
  • 9
1
vote
3 answers

How can I launch programmatically (C++) an application from a Windows shortcut (.lnk file)?

how can I launch programmatically an application from a Windows shortcut (.lnk file)? I tried to use the API ShellExecute and it seems to work. Any caveat? Thank you. Here it is a snippet of my current code: #include #include…
Alessandro Jacopson
  • 18,047
  • 15
  • 98
  • 153
1
vote
1 answer

How do I edit the Target property in a shortcut to include a character after the file path using Powershell?

To run a new, discrete instance of an application we have been manually creating a shortcut of the application .exe file and then editing the Target property of the shortcut to include a space and character(s) after the closing quote mark of the…
XMHell
  • 11
  • 2
1
vote
2 answers

Spawning a .lnk windows shortcut with node.js gives "UNKNOWN" error

I'm having a game spawned as a child process. It all works nice and well with the game's original .exe file. However, I'd like it to execute minimized, and the only way to do it as far as I can tell is to create a windows shortcut (.lnk file, in the…
Drithyl
  • 43
  • 4
1
vote
2 answers

Problems with some system default .lnk-files launching from under an impersonated user

I'm writing the 32bit service app where I want to be able to launch Start menu items for the logged users. I did manage to accomplish this task by impersonating user and launching selected .lnk-file using CreateProcessAsUser with command-line:…
teapot_of_wine
  • 516
  • 3
  • 18
1
vote
2 answers

Execute a batch file before executing in a shortcut (.lnk)

I have multiple versions of a program called Siemens NX. NX uses environmental variables for configuration. I need NX 10.0 to use a different set of environmental variables than my NX 7.5 which uses the system environmental variables. Therefore, I…
Jason Nicholson
  • 178
  • 2
  • 13
1
vote
2 answers

Generated script doesn't create shortcuts

My Windows 8 PC doesn't seem to want to create Shortcuts using VBScript. The problem is, that it somehow can't be saved. This seems to be a problem only my PC has. I am trying to create a temporary VBScript using Batch, the output I get…
Albert MN.
  • 713
  • 1
  • 16
  • 33
1
vote
1 answer

Creating a lnk in VBS

I get an error that on line 6, the one with lnk.TargetPath, that the argument is invalid. I am hoping to make a link to this program under the start menu on the desktop. Anybody know why it is doing this? Set objShell =…
1
vote
2 answers

Redirection in windows shortcuts

I have a batch file that looks like this: netsh interface dump > net.cfg And I would like to run the actual command from a shortcut, so I tried all of this (in the .lnk shortcut): %windir%\system32\netsh.exe interface dump >…
Ulrik
  • 1,131
  • 4
  • 19
  • 37
1
vote
0 answers

.LNK File Shortcut Key no longer works if I press it while my C#, maximized, no border program is running

For a more general behavior probably caused by this problem please also read: https://stackoverflow.com/questions/2042925/shortcut-keys-defined-in-lnk-files-do-not-work-if-im-running-a-c-winforms-prog I'm writing a C# program, using .NET 2.0 and…
TechAurelian
  • 5,561
  • 5
  • 50
  • 65
1
vote
1 answer

How I can use Shell32.dll in Silverlight OOB

I'd like to get the target information from a shortcut file using my silverlight OOB app, so I'm going to make the following code to work in my silverlight OOB. It seems I have to used P/Invoke to use Shell32.dll, but I'm not sure how I can use…
1 2 3
8 9