Command Prompt Windows icon. Can it be changed - pic enclosed.

Discussion in 'Scripting' started by tnx, Jan 17, 2017.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,608
    228
    60
    Was a little bored so got to updating some of my old DISM command I use. Then suddenly thought it might be nice to change the icon that is in the top left of the command prompt window.

    Googling did not help really so I thought I'd ask here..

    [​IMG]
     
  2. ThomasMann

    ThomasMann MDL Addicted

    Dec 31, 2015
    839
    124
    30
    You must have an incredibly interesting life.....
     
  3. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,608
    228
    60
    Can't help ? No ? interesting !
     
  4. bear_aussie

    bear_aussie MDL Junior Member

    Jun 8, 2015
    56
    27
    0
    #4 bear_aussie, Jan 19, 2017
    Last edited: Jan 19, 2017
    console windows just use the first icon in their executable as the icon (if there isn't one it just uses that ugly white "generic" icon). its hardwired into the console window host to my knowledge

    the only way off the top of my head that I can think of to override this would be detour (read: hijack, rootkit) conhost.exe as it starts up and rejig where it loads the icon from when it registers the console window class - would not be fun :(

    edit - might be able to do some magic with a remote thread, LoadResource and SendMessage come to think of it
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,608
    228
    60
    Cheers for that info, sounds too complicated just to have a mess about with.
     
  6. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    871
    456
    30
    create a shortcut, change icon. works
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. TirOFlanc

    TirOFlanc MDL Novice

    Jul 28, 2015
    18
    4
    0
    Solution #1

    Hi,

    You can change this icon ! ;)

    [​IMG]

    To make it, you have to compile your bat file in exe.
    I use "Bat To Exe Converter" downloadable here : http://www.f2ko.de/en/b2e.php

    Features


    • Extended commands
    • Visible and invisible applications
    • Executables with administrator priviliges
    • Inclusion of additional files, folders, *icon* and version information
    • Creation of 32-Bit and 64-Bit EXE files
    • Commandline interface
    • Portable
    • Encryption
    • Multilanguage support
    • Free for commercial and non-commercial use

    Have fun mate ! ;)
     
  8. TirOFlanc

    TirOFlanc MDL Novice

    Jul 28, 2015
    18
    4
    0
    It's worth it ! :p
     
  9. TirOFlanc

    TirOFlanc MDL Novice

    Jul 28, 2015
    18
    4
    0
    Obviously, it's just for *.bat files, not for the command prompt directly ...
     
  10. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,608
    228
    60
    Yep, know how to set up icons for shortcuts to .cmd, .vbs too but just wondered about the command promt window.

    It was just the other day I was messing about with DISM and a Win 10 image. I have my .cmd files with DISM commands on them and when run the command promt window pops up and tells me whats going on like. I like to see whats happening but thought it might be nice just to have a different icon in the command window.

    No big thing really.

    ;)
     
  11. kaljukass

    kaljukass MDL Addicted

    Nov 26, 2012
    825
    269
    30
    #11 kaljukass, Jan 21, 2017
    Last edited by a moderator: Apr 20, 2017
    I made a few, here is one a sample, it bases on 10.0.14393.0 cmd.exe (in Windows 10).
    Download, unpack, and you want, can to test.
    Code:
    [FONT=source_sans_proregular]https://mega.nz/#!tsYDCYZT!R2TB2jWLs8PPCz5gwukGJq4m8I-1NnLfsJL800LUyo0[/FONT]
    virustotal.com - https://virustotal.com/en/file/20d3...15d1813d488e5c829d86b5ad/analysis/1485006363/
    SHA256:20d3e8ef5c49be369e9f35afaad8aed6d0ab386915d1813d488e5c829d86b5ad
    File name:cmd.exe
    Detection ratio:0 / 55
    Analysis date:2017-01-21 13:46:03 UTC
     
  12. JFKI

    JFKI MDL Expert

    Oct 25, 2015
    1,098
    369
    60
    I am surprised no one has given you the correct answer.

    Here it is in screen grabs on Windows 7 :

    Right click on Command Prompt...

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
     
  13. kaljukass

    kaljukass MDL Addicted

    Nov 26, 2012
    825
    269
    30
    Strange coincidence. This answer is not correct, but in this case, the works. It method changes only shortcut icon, but not .exe file icon.
     
  14. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    5,721
    13,163
    180
    Are you surprised or fulfilled with pride and arrogance YOU are the only one with the intelligence to solve this riddle?
     
  15. JFKI

    JFKI MDL Expert

    Oct 25, 2015
    1,098
    369
    60
    Frankly I am shocked.
    I thought, apparently mistakenly, that MDL had intelligent users.

    So is that SSD working OK for you? :rolleyes:
     
  16. JFKI

    JFKI MDL Expert

    Oct 25, 2015
    1,098
    369
    60
    #16 JFKI, Jan 21, 2017
    Last edited: Jan 21, 2017
    The opening poster was not asking to change the icon within the .exe file, which is also not that hard to do but requires some more advanced tools.
    But doing so would also break things like SFC.
    He was asking to change the icon on the command prompt window.

    Edit to add:
     
  17. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,608
    228
    60
    Indeed I was...

    When running a .cmd file as admin, mainly some DISM command I thought it would be nice if the little icon reflected DISM in some way. A custom icon of my own making perhaps.
    Making shortcuts have different icons I am able to do but I do thank folk for all their input.

    Seems too much trouble for the little reward so I recon I will let this go.

    :cool:
     
  18. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    871
    456
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...