UVNC Viewer – reverse connection sound notification option

Any feature you'd like to see in Ultr@VNC? Just propose it here.

UVNC Viewer – reverse connection sound notification option

Postby CPC » 2019-02-10 17:20


I’m seeking a way for the VNCviewer to notify me with a sound or email when someone connects via a reverse connection.

Currently when someone seeking help initiates a reverse connection, I sometimes don’t notice the connection request / support request if I am not looking at the screen.

For example... "C:\Program Files (x86)\UltraVNC\vncviewer.exe" -listen -quickoption 3 -scale 8/10 -notify notify.wav (Note: this doesn’t work it’s just an example/feature request)

Maybe "Notify upon connection" could be an option to add to the unvcviewer connection options screen next to “Deiconify on Bell” <--which lets you choose the wav file in windows sound settings like with the Deiconify Bell? Better yet, let the user choose a batch file to run upon "connected".

Current setup:
My vncviewer end… Win10 running UltraVNC Viewer 32bit listening for reverse connections.
"C:\Program Files (x86)\UltraVNC\vncviewer.exe" -listen -quickoption 3 -scale 8/10 -password yourdmspassword

The vncserver end… A variety of PCs running Win10 (and older) and UltraVNC Server 32bit (and older) ready to run with a single click reverse connection to the support person's viewer.

Thanks in advance for any suggestions and/or if you add this option to the viewer
Thanks for UVNC. A great program I have been using for many years.

Edited by CPC 2019.2.15 shorten
Posts: 45
Joined: 2010-10-08 15:31

Re: UVNC Viewer – reverse connection sound notification opti

Postby CPC » 2019-02-16 07:57

A reverse connection sound notification built into VNCviewer would be a handy option to alert the helpdesk of a support request. Given an option to run a chosen batch file upon connection, would be even better.

In the meantime, here is a working method to optionally receive a sound notification and/or an email alert upon a reverse connection being “connected”. I find this helpful if I am not watching the screen or when I am not in the same room. I’m sure there are probably easier ways to do this. Maybe others will find this helpful?

Overview: Set VNCviewer.exe to record a log file. A small 3rd party program monitors the log file for the word “Connected” to appear and when it does the 3rd party program can play a sound and/or send an email alert.

This is for VNC viewer running on a Windows 10 PC and requires VNCviewer.exe to either be ran as an Admin (if located in the default program files location) or install VNCviewer to a location like C:\UltraVNC so it doesn’t need admin rights… and there may be other ways.

Getting VNCviewer to record a log file add -loglevel 1 -logfile vncviewer.log
Example: C:\UltraVNC\vncviewer.exe -listen -quickoption 3 -scale 8/10 -password yourpassword -loglevel 1 -logfile vncviewer.log

Next I’m using a small open source program (under 1MB) called SnakeTail to monitor the logfile. See http://snakenest.com/snaketail I put a SnakeTail subfolder inside the UVNC folder along with a few batch files and “laser.wav” from windows.

SnakeTail needs a couple files for its “external tools” and they can be created in many ways.
I used a Sound.vbs file with the help of a google search. A batch could be used instead.

Example: In a text file put the following and then save it as Sound.vbs.

Set Sound = CreateObject("WMPlayer.OCX.7")
do while Sound.currentmedia.duration = 0
wscript.sleep 100
wscript.sleep (int(Sound.currentmedia.duration)+1)*1000

(Don’t forget to put your wave file in the same folder as the vbs.)

Example: SoundandEmail.bat - (Makes a sound and sends an email alert)

start /min Sound.vbs
Powershell.exe .\SendEmail.ps1

For the SendEmail.ps1, I used the directions from this website.
https://www.instructables.com/id/Automa ... Batch-Fil/

In Snaketail create and save a session with the following...
Edit… view options...External Tools. Add two tools… #1 Sound.bat or Sound.vbs to play a sound, and #2 SoundandEmail.bat (if you want to have the choice to email alerts as well.)
Edit… view options… “Configured view”… keyword “Connected” with the Launch External Tool selected and pointing to which tool you want to run #1 or 2 from above. I set the “log tab” to my vncviewer.log and the timers to every 10 seconds. Don’t forget to choose File…Save Session and name it something like. VNCviewerSoundAlert.xml

Create a shortcut on your desktop for SnakeTale.exe as follows with your xml in the target.
C:\UltraVNC\SnakeTail_SoundAlert\SnakeTail.exe VNCviewerSoundAlert.xml

With the above in working order… Launch VNCviewer first and then Snaketail with the parameters given above. Optionally, create a batch file to launch them both. When someone needs help on the server side and starts a reverse connection, you will be alerted on the viewer side via a sound or email 8)

This takes some effort, but it works reliably for me.

It would be great to have an easier option within the VNCviewer to run a batch file on a reverse connection when the status = “connected”. Then the user can have control of the type of notification(s).
Having this built into VNCviewer will make it easier for anyone to do this and require less processes running on the system. For example: VNCviewer knows when status=connected instead of having a 3rd party program monitor and checking the log file continuously.

Thanks for UltraVNC
Posts: 45
Joined: 2010-10-08 15:31

Re: UVNC Viewer – reverse connection sound notification opti

Postby CPC » 2019-02-19 23:55

Wow Rudi.. That will catch someones attention... or everyone in the building :D
It plays "sound.wav" in a loop over and over until a person at the viewer end clicks accept. I love it, it drives everyone else nuts if I am not at my desk. :tomato:

1.2.24 Release ( web release for 01/03/2019)
postby Rudi De Vos » 18/2/2019, 1:45 pm

-added sound call for reverse connection: just add sound.wav to the same folder as the viewer.

Is there a way to change it to just play 1x instead of endless loop and not need to hit accept?
Better yet, is there way to change it to play a "notify.bat just one time and not need to hit accept?

If we can run a "notify.bat" instead, the user can then choose to play a sound or send an email or both... whatever they choose with their own custom batch file.
(Example sound and email batch available that I have been using. I find receiving the email notification very handy for when I am not in the same room)

Edited 2/20/2019...to make it simpler...and possibly reduce code

In VNCviewer there is already a point that the Status becomes equal to "Connected" and triggers event "Connected to RFB server""
At this same point when status becomes "Connected" add...
Run "notify.bat" one time if "notify.bat" exist in folder. (With no extra loop or extra button to press)

Just a suggestion to make for less code and more versatile for end users.

Thank you for doing this so quickly.

*** (I will post this this comment in the version specific area as well. Not sure which thread is better to discuss in. Admin delete one or the other if better to keep conversion in one thread.)
Posts: 45
Joined: 2010-10-08 15:31

Re: UVNC Viewer – reverse connection sound notification opti

Postby Rudi De Vos » 2019-02-20 16:29

Wouldn't that be a security risk...

executing a bat on request of a remote connection.
Playing a sound is just a sound, in a bat can be everything

1x and remove the accept box OK
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6108
Joined: 2004-04-23 10:21

Re: UVNC Viewer – reverse connection sound notification opti

Postby CPC » 2019-02-20 22:38

Hello Rudi

RE: Security risk..good point I understand the concern.

However, the bat that the Professional IT Tech /admin optionally creates and optionally puts in his VNCviewer folder is at the VNCviewer end and optionally plays only on the VNCviewer end. Not the VNCserver end and should not effect the server at all.. I don't see much of an issue at my end with this, but everyone's situation is different. Edited 2/21/2019: shortened and will send a PM re: security instead.

The VNCviewer end (as you know) is the end where the more knowledgeable tech should be providing help from and is in control. If a person wanted to mess with the server, they don't need a bat file to do it as they already have full remote control of the server at this point and can often do whatever they like.

The initial continuous sound loop in definitely grabbed my attention as it should. However, if the viewer is left listening and nobody is at the desk, it plays over and over and could drive others nearby insane. :shock:

Without a batch file, to get an email alert directly from VNCviewer might be a lot more code in UVNC and users would need to put their outgoing email info into VNCviewer somehow. (For now I can use my vncviewer.log monitor to trigger my email alerts of incoming connections. Its small and simple, but it's another separate process running that I though might be easier done from VNCviewer... but maybe not.)

For now... simplified... "1x and remove the accept box OK" would be great... less code, simple, stable. No extra loops or buttons or boxes. : :P
I think users will find this as an nice optional feature.

Thank you very much Rudi. Great work and very responsive.
(As always... I'm happy to beta test and give feedback etc.)

*edited 2/21/2019 to shorten on security subject.
Posts: 45
Joined: 2010-10-08 15:31

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 4 guests