Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • October 17, 2017, 03:52 PM
  • Proudly celebrating 10 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 250 times)

highend01

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

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
        break
}

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 »