Windows 7 – How to Execute Shortcut from Command Line

command linewindows 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?

Best Answer

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