Thursday, April 6, 2017

Cygwin to execute windows shortcut files (.LNK)


I use Cygwin as my cmd replacement on Windows and I am in the process of cleaning up my system PATH variable.


I now have a folder containing exe's and shortcuts (.LNK) files which is in PATH containing all the small apps and software I use from the command line.


Everything works through CMD, however the shortcuts, .LNK files, do not work through Cygwin.
Instead I get



bash: /cygdrive/e/Apps/uniserver.lnk: cannot execute binary file



My only guess is because it thinks .lnk is supposed to be a symlink?


Is there anyway to get Cygwin to launch the shortcut?


Answer



You can execute Windows LNK files from Cygwin using the cygstart utility, part of cygutils package, as follows:


cygstart [OPTION]... FILE [ARGUMENTS]

See cygstart --help for the options available.


The following should be enough in your case:


cygstart /cygdrive/e/Apps/uniserver.lnk

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...