message box icons ? The one showing up on taskbar - Pic included

Discussion in 'Scripting' started by tnx, Jun 15, 2014.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    Hi all.

    tnx bored again so having a mess about. Been creating a very simple .cmd to show a couple of messages while an install.wim is being mounted.
    Also a simple .vbs to run the .cmd without the command window showing, so all I see are the message boxes.

    It works quite well but there is one thing bugging me.

    Now I am not confessing to be a good scripter what so ever so all I do is very simple. Bare this in mind...:D

    When I run the mount.cmd a message pops up to tell me to wait, install.wim is being mounted.

    But the message box as an awful looking icon attached to it. see pic.

    IMG_0375 - cropped.jpg

    What I would like to know is it possible to have a different custom icon attached to it.

    Summet like this maybe,

    tn icon.jpg

    Any thoughts, you clever lot...

    Bet I'm barking up the wrong tree, as usual :biggrin:
  2. Compo

    Compo MDL Member

    Mar 29, 2011
    #2 Compo, Jun 16, 2014
    Last edited by a moderator: Apr 20, 2017
    Unfortunately the only ways I think you could affect the icon is to either use something other than wsh/vbscript, such as powershell or to perferably create a .hta based gui.

    Here is a VBScript example which will use PowerShell to create the MessageBox:
    Set objShell = CreateObject("Wscript.Shell")
    sMsg = "'Your install.wim is being mounted; Please Wait...'"
    sTTL = "'Mounting Wim'"
    objShell.Run("PowerShell -c " & _
     """[System.Reflection.Assembly]::LoadWithPartialName" & _
     "('System.Windows.Forms')|Out-Null; $A=" & _
     "[System.Windows.Forms.MessageBox]::Show(" & sMsg &"," & sTTL & ",0,64);"""),0
    This doesn't provide you with a custom icon, but it should at least use the powershell icon in your taskbar.

    Without seeing your entire code, there's little else I can suggest!
  3. tnx

    tnx MDL Expert

    Sep 2, 2008
    #3 tnx, Jun 17, 2014
    Last edited by a moderator: Apr 20, 2017
    Cheers for that.

    Funny you talk about making my own GUI. I have been messing about with Autoplay Media Studio and I have just the other day installed Visual Studio 2013 but not realy played with it yet.

    This just for my own amusement but I would love to learn how to have a progress bar show the time it takes for an install.wim to be mounted.

    I will use you code later on when I get more time.:cool: