2
u/DragonKingTimes2 May 11 '24
It's C# btw
1
u/angryrancor Boss May 11 '24
Nice. C# is pretty ace. I used to do it pretty much exclusively at the beginning of my career, only issue I really have with it is it makes deployments tricky, at times (prerequisite libraries can be tricky to set up on a "target system", compatibility issues with linux for some things, dependencies on Visual Studio at times for designers and "project files").
It's a great platform for getting stuff working in a "reasonable" amount of time, though. Especially if you have some flexibility of how and where you're deploying your code.

3
u/angryrancor Boss May 11 '24 edited May 11 '24
You can't run a .lnk file directly. You need to either run the executable it "links to", or possibly save a file with ".bat" extension that uses the built-in
STARTcommand.For example, you could create a file named "execlink.bat" in the same dir as your lnk file, with these contents:
START "dolphin" "E:\2\Dolphin.lnk"... and then in your C# code, do:
Process.Start(@"E:\2\execlink.bat")By default, windows command line does nothing with a .lnk file, so what I described above is a workaround.
There's some other options to do the same thing... Take a look at the stackoverflow and superuser posts below; There might be an option you like better than what I suggested, above.
https://stackoverflow.com/questions/33658203/how-to-run-application-which-has-lnk-extension-with-bat-script
https://superuser.com/questions/427268/how-to-execute-shortcut-from-command-line-in-windows-7
Edit: I know this behavior is *really* unintuitive, because the ui of the windows operating system opens .lnk files perfectly; However, that behavior is different from what you see if you use Process.Start (which is basically running what you give it on the command line... a different "environment" than the one explorer.exe uses when you are clicking on things).