Search code examples
batch-file

how to run application which has .lnk extension with .bat script


how to run application which has .lnk extension with .bat script? (I have an application and short of that is .lnk extension and want to run it using .bat)

error is that its not running


Solution

  • A file with .lnk extension is just a shortcut to a file.

    To launch the executable that the shortcut targets to, just write the shortcut filename in the same way as you will do to run a executable file, as follows:

    @Echo OFF
    "C:\path to your shortcut.lnk"
    Exit
    

    Or also:

    @Echo OFF
    Start /Wait "" "C:\path to your shortcut.lnk"
    Exit