avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday February 21, 2024, 1:39 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: .lnk files - arguments not passed to .exe?  (Read 2344 times)


  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
    • View Profile
    • Donate to Member
.lnk files - arguments not passed to .exe?
« on: August 23, 2017, 03:32 AM »

A very simple .ahk script, that outputs all command line parameters it receives

Loop, %0%  ; For each parameter:
    param := %A_Index%  ; Fetch the contents of the variable whose name is contained in A_Index.
    MsgBox, 4,, Parameter number %A_Index% is %param%.  Continue?
    IfMsgBox, No

This one will be compiled into "Get command line parameters.exe"

If invoked from a command prompt with:
"R:\Get command line parameters.exe" "arg1" "arg2"
It outputs both arguments correctly

But when I now create a shortcut to the .exe file
"R:\Get command line parameters.exe.lnk"

and put the command line arguments into the target field of this shortcut e.g. with:
"R:\Get command line parameters.exe" "arg1" "arg2"

The called .exe will output: nothing!

Both params aren't passed to the .exe file...

System: Windows Server 2012 R2 U3 x64

Does anyone have an idea on what is causing this behavior?
« Last Edit: August 23, 2017, 03:54 AM by highend01 »