1
CreateObject("WScript.Shell").PopUp "The CPU is hot.", 5

The above is used in a vbs file. The message box will appear in the center of the screen.
Is it possible to make it appear just above the notification area?

3
  • You haven't included pop-up_message.vbs :/
    – DavidPostill
    Nov 22, 2016 at 10:51
  • 1
    No cmd/vbscript but powershell can show a notification balloontip works nicely in Win10
    – LotPings
    Nov 23, 2016 at 21:48
  • Sorry, I don't understand it. I had saved the codes there into a ps1 file, but no balloontip appeared when I ran the file. Nov 24, 2016 at 8:01

1 Answer 1

1

By googling, I found the following way to display a balloon tip:

[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon 
$objNotifyIcon.Icon = "D:\folder\image.ico"
$objNotifyIcon.BalloonTipIcon = "None" 
$objNotifyIcon.BalloonTipText = "The CPU is hot!" 
$objNotifyIcon.BalloonTipTitle = "Warning"
$objNotifyIcon.Visible = $True 
$objNotifyIcon.ShowBalloonTip(10000)

Save the above in a .ps1 file and use the following in a .bat file to run the .ps1 file.

powershell -executionpolicy bypass -file "D:\folder\BalloonTip.ps1"
PING -n 10 LOCALHOST
"D:\folder\NoTrayOrphans.exe"

The .bat file can be run without a command window via the following code in a .vbs file:

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) & "D:\folder\BalloonTip.bat" & Chr(34), 0
Set WshShell = Nothing
1
  • what is "D:\folder\NoTrayOrphans.exe"?? and, should that line be part of the previous line?
    – ashleedawg
    Aug 7, 2019 at 10:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .