none
Taskbar application icon does not start a second instance of the same application if started by command file.

    Question

  • All,

    I have an installed application that is being started with additional parameters through a command file located on the desktop.

    Example content of cmd file: start notepade.exe c:\temp\text.txt

    Executing this command file, will start correctly notepad.exe and opens correctly the text.txt file.

    Looking now in the taskbar, you will see the Application Icon of Notepad.

    Right mouse click on the application icon, gives you a menu  from bottom up: "Close Window", "Pin this program to taskbar" and "notepad"

    Choosing now menu item Notepad, then a second instance of Notepad.exe is started, BUT NOT the expected second instance of the used Command file!

    Resulting in the application (in this case notepad) is started without using the additional option that opened the required text.txt file, presenting an empty notepad instance.

    Does anyone know how to change the behavior of this application icon in order to start the Command file instead of the application itself?

    Thanks in advance,

    Nico Peereboom

    • Edited by Nico AMS Wednesday, November 05, 2014 11:30 AM
    • Moved by Carl Cai Friday, November 07, 2014 2:40 AM not related to winform controls or API and look for more related forum
    Wednesday, November 05, 2014 11:25 AM

Answers

All replies

  • Hello,

    For editing the shortcut to get the application which it references to, you could right click on that task bar icon ->right on its shortcut->select properties->adding that additional parameter after the target property with a space.

    E.g, right click on that notepad taskbar icon->right click on "Notepad"->select "Properties"->Shortcut->Target->Type a space and the parameter, in this case that should like "%windir%\system32\notepad.exe c:\temp\text.tx" as the following image shows.

    If you want to change the behavior for the shortcut which will display when we right click on that taskbar icon, and it will open like the result starting with command line, then I am afraid that this issue is not supported in this forum because this issue is not related to windows form application and it is a system behavior that we could not change.

    Regards.

    Carl


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 06, 2014 3:04 AM
  • Hi Carl,

    I know that this is system behavior, but that is just the problem. Customers expects that the icon will be starting the batch / or command file and NOT the application like in this example.

    You wrote: "I am afraid that this issue is not supported in this forum because this issue is not related to windows form application". Can you please tell me which forum I should have used to get this addressed?

    Regards,

    Nico 

    Thursday, November 06, 2014 11:11 AM
  • Hi Carl,

    I know that this is system behavior, but that is just the problem. Customers expects that the icon will be starting the batch / or command file and NOT the application like in this example.

    You wrote: "I am afraid that this issue is not supported in this forum because this issue is not related to windows form application". Can you please tell me which forum I should have used to get this addressed?

    Regards,

    Nico 

    Hi Nico,

    As far as I know there isn't a way to change the taskbar behavior by coding, and IMO that is not supported to change its behavior.

    In order to get where to get help for issues regarding changing taskbar behavior, I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.

    Maybe the following forum will help.

    http://answers.microsoft.com/

    Thanks for your understanding.

    Regards.

    Carl


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 07, 2014 2:39 AM
  • I'd try them over here.

    Windows Desktop Dev forums on MSDN

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Friday, November 07, 2014 3:00 AM
    Moderator
  • Thanks Carl and Dave.

    I will post it there.

    Regards,

    Nico

    Friday, November 07, 2014 1:12 PM
  • You're welcome.

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Friday, November 07, 2014 3:37 PM
    Moderator