Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 10 down vote accepted

If you use double quotes around your "long file names.lnk" and you have privvies, 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

share|improve this answer

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

share|improve this answer
    
as long as the .lnk file is in the path environment for windows it will work. otherwise not. YOu can run any service using win+R ...net start msiserver .. for example starts the Windows Installer service.. or any MS Console using run... xxx.msc (these are located in windows32 folder and in PATH) –  Tony Stewart Jun 28 '12 at 4:33
1  
Actually, in order to work I had to do START "Name of the new window" "filename.lnk". With only one arg START was just creating a new command line window named after the first parameter. See related on StackOverflow: stackoverflow.com/questions/6139365/… –  Rafael Oliveira Sep 19 '13 at 15:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.