Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Is possible to send notification to Action Center by batch file?  (Read 4234 times)

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

    Topic Starter


    Hopeful

    Thanked: 2
    Is possible to send notification to Action Center by batch file?
    « on: November 23, 2018, 02:12:39 PM »
    Hi!

    I need to notify some actions of my batch files scheduled in time - notify about success/failure.
    It's easy to notify by window - but it remains on screen until is closed.

    Is possible to send notification to action center from BAT (batch) file?

    Thank you for all suggestions.
    Miro

    Salmon Trout

    • Guest
    Re: Is possible to send notification to Action Center by batch file?
    « Reply #1 on: November 24, 2018, 01:56:58 AM »
    Are you willing to install an app, or must it be entirely Windows native? I personally use Growl for this; it can even show notifications from other computers on the LAN, using Windows, MacOS, or Linux, provided they have a Growl sender installed. Today, the official site seems to be down, but there is a Github branch

    https://github.com/MartinSGill/growl-for-windows-branched

    Official site:

    http://www.growlforwindows.com/

    Another similar alternative is Snarl

    https://snarl.fullphat.net/



    « Last Edit: November 24, 2018, 02:19:20 AM by Salmon Trout »

    Salmon Trout

    • Guest
    Re: Is possible to send notification to Action Center by batch file?
    « Reply #2 on: November 24, 2018, 03:11:02 AM »
    Or you can create notifications with this app

    http://www.l2adv.com/_32BitProgs/L2ToastNotification.zip


    MIRKOSOFT

      Topic Starter


      Hopeful

      Thanked: 2
      Re: Is possible to send notification to Action Center by batch file?
      « Reply #3 on: November 24, 2018, 09:18:32 AM »
      Hi!

      I was searching net and found really nice not require any program, here's:

      Code: [Select]
      call :notif "{The title}" "{The message}"

      :notif
      ::Syntaxe : call :notif "Titre" "Message"

      set type=Information
      set "$Titre=%~1"
      Set "$Message=%~2"

      ::You can replace the $Icon value by Information, error, warning and none
      Set "$Icon=Information"
      for /f "delims=" %%a in ('powershell -c "[reflection.assembly]::loadwithpartialname('System.Windows.Forms');[reflection.assembly]::loadwithpartialname('System.Drawing');$notify = new-object system.windows.forms.notifyicon;$notify.icon = [System.Drawing.SystemIcons]::%$Icon%;$notify.visible = $true;$notify.showballoontip(10,'%$Titre%','%$Message%',[system.windows.forms.tooltipicon]::None)"') do (set $=)

      goto:eof

      It sends notification to Action Center.

      Also command line allows to notify by window:

      msg {username} "{message}"

      Thank you for all. Hope this can help also others.
      Miro