Hi
In order to achieve this you can create a property in the Install Parameters page (i.e. DESKTOP) and set its value to 1.
Then go in the Organization page, select the component that contains your shortcut and set its condition based on the property you created (DESKTOP = 1).
When you run your package in command line you can change the DESKTOP property value (i.e. DESKTOP=0). In this case the shortcut will not be installed anymore.
The
Create Shortcut based on checkbox status thread shows you how to move a shortcut in its own component.
Let us know if this helps, otherwise give us more details about your scenario.
Best regards,
Eusebiu