Toxa
Toxa

Reputation: 17

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 Menu\Programs\Startup. I tried to use cmd command mklink, but this command creates .symlink, not .lnk.

How can I add my file to Autorun, apart from creating .lnk shortcut? How create .lnk, using only C++ and cmd (not js, Powershell, BAT, etc.) I know, that .lnk is just a txt file in HEX code? so I can put text with address in it and change add-in. It is not good way, in my opinion.

Upvotes: 1

Views: 706

Answers (1)

user7860670
user7860670

Reputation: 37578

.lnk is a binary file with specific format. The proper way to enable autorun is to create a registry entry in Run or RunOnce sections.

Upvotes: 2

Related Questions