locked
Shortcut - Target arguments disapearing when starting with @ RRS feed

  • Question

  • Hello everybody,

    We have applications that require something a big number of command-line arguments and/or some of them can be quite long. In consequence, we hit the limit on the command-line length of a shortcut. And even without the limit, as the Properties dialog of a shortcut is not resizable, it can be very difficult to edit them.

    Therefore to help use, we modified the applications to be able to take command-line arguments from response files. We took a similar route to how the C# compiler does it: http://msdn.microsoft.com/en-us/library/8a1fs1tb.aspx ; our response files are specified on the command-line with the @ character.

    However, we discovered that when a shortcut’s argument starts with the @ character, the Properties dialog of the Windows’ Shell does not display the argument anymore, only the executable path (tested on Windows 7 and 8).

    To reproduce it, simple follow these steps:

    • Create a shortcut to an application, such as notepad
    • Open the Properties dialog of the shortcut
    • Add @test.txt to the Target as first argument to the executable
    • Click OK to save the changes
    • Re-open the Properties

    You’ll see that the argument is not there anymore. However, if you launch the shortcut, you’ll see that it was correctly passed to Notepad, as it prompt you to create the @test.txt file.

    It can be worked around by quoting the argument, or having another argument before, but can be quite annoying. Is this a known and expected behaviour? Where does it come from?

    Friday, March 15, 2013 3:58 PM

Answers

  • @ is a console thing for do the command after this but, don't display the input.

    Try both of these from a command line:

    @echo this is at echoed
    echo this is just echoed notice that you can see the command
    It demonstrates the behavior.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ” How to ask a question that is fixable.



    • Edited by Ty Glander Monday, March 18, 2013 2:55 PM
    • Marked as answer by fgeo Monday, March 18, 2013 8:55 PM
    Friday, March 15, 2013 10:25 PM

All replies

  • @ is a console thing for do the command after this but, don't display the input.

    Try both of these from a command line:

    @echo this is at echoed
    echo this is just echoed notice that you can see the command
    It demonstrates the behavior.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ” How to ask a question that is fixable.



    • Edited by Ty Glander Monday, March 18, 2013 2:55 PM
    • Marked as answer by fgeo Monday, March 18, 2013 8:55 PM
    Friday, March 15, 2013 10:25 PM
  • Is the reply helpful? If you have any update, please let me know.


    Niki Han
    TechNet Community Support

    Monday, March 18, 2013 2:33 AM
  • @ is a console thing for do the command after this but, don't display the input.

    Try both of these from a command line:

    @echo this is at echoed
    echo this is just echoed notice that you can see the command
    It demonstrates the behavior.

    Strangely, while having use @ in dozens of batch files, I didn’t do the link with it. It really surprised me to see that behaviour in a shell/graphical environment. Thanks for reminding me that.
    In addition, I’m not sure hiding the arguments in the Properties dialog but still using them is a good behaviour, was not expected. But maybe it will be useful in the future to hide the command-line arguments of a shortcut ;)

    But in overall, we might have to change of – or allow another – character to specify a response file. I don’t want to end having to explain that in the documentation for all developers/technical operators who will have to set them (and that they probably won't read).

    Monday, March 18, 2013 8:55 PM