How to Execute ShortCut From Command line in Windows 7

We came with a scenario where we have to use Shortcut file (.lnk), which is on the desktop, to execute an application for a headless device (i.e, without manual intervention).

Is there any way to execute it from Command prompt?


Solution 1:

If you use double quotes around your "long file names.lnk" and you have appropriate privileges, it will execute. Quotes are needed when spaces exist in LFN's.

E.g. "C:\Users\Sunny\Start Menu\Programs\XBMC\xbmc.lnk" opens up XBMC. The same is true for the Run box Win+R "path and filename.lnk", Enter

Solution 2:

START filename.lnk should do the trick

As long as there is no exe with the same name as the shortcut, you can omit the .lnk, so just START filename