“Always stay on top” for WScript.Shell.Popup

WScript.Shell.Popup has an undocumented value for the nType parameter which causes the resulting dialogs/popups to “stay on top” / in foreground, meaning that they cannot be hidden by other windows or dialogs: 4096.

JScript example:

WScript.CreateObject(“WScript.Shell”).Popup(“Message”, 0, “Title”, 4096);

VBScript example:

WScript.CreateObject(“WScript.Shell”).Popup “Message”, 0, “Title”, 4096

6 Responses to ““Always stay on top” for WScript.Shell.Popup”

  1. abc Says:

    terrific, thanks a lot!

  2. Ed Says:

    thanks man, this helped a bunch

  3. venkat Says:

    Thanks it helped me too

  4. Anton Says:

    Exactly what I needed. Thanks a lot man.

  5. saqib Ahmed Says:

    Thanks mate in powershell just use

    $wshell = New-Object -ComObject Wscript.Shell
    $wshell.Popup(“Work Done”,0,”Done”,4096)

Leave a comment