ClickOnce Deployed shortcut with cmd params

  • 14 years ago
    Hi All, I am new to the world of click once apps.

    I have updated a few existing apps to use .net & the clickonce deployment.

    all is working well but now I need to pass a command line parameter to the exe when starting.

    I draged the startup shortcut from the program files menu onto the desktop but when I go to edit it there is no target exe or anywhere for me to put command parameters as I have done in the past (e.g. "c:\myprogram.exe" "param_value")

    HELP!!!

    What do i need to do to be able to launch my app passing a prarmeter? (its an offline app & users run from a desktop shortcut).

    Any help is much appreciated,.
    Cheers














  • 14 years ago
    hi
    i think its impossible. its a bug (see this link)
    You won't be able to pass parameters via start menu shortcut. This is not supported.



    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=264868&SiteID=1

    -Amjath







  • 14 years ago
    Thanks for the reply, I had seen that post & was shocked no one has found a work around.

    I thought I would post my solution that works for my senario

    Senario: when the program starts it prompts the user to select a configuration/database they would like to connect to.

    Solution: I ran out of time as users were getting anti so I use AutoIt which works well for this task as I just get the script to select from the known configs. AutoIt has the great feature of being able to comple the script to an exe with no dependencies.

    If anyone has any other solutions i would love to hear them
    Nez










  • 14 years ago

    No, I am quite sure it is possible. Firstly at app. level you should use Sub Main(paramarray$()),
    and to .lnk: you should be able to drop arguments over lnk to exe I guess its implicitely ok, you musn't edit that lnk or add some %1 ... it is running well as it is:

    lnk.path = 'myapp.exe'
    run lnk 'abc' -> app.started(myapp 'abc')

    I guess all should be allright

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”