Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

VNCViewer Command Line Switch

Post Reply
AndyL
8
8
Posts: 9
Joined: 2012-12-17 15:58

VNCViewer Command Line Switch

Post by AndyL »

Is there a command line switch for the viewer that you can set so if the connection is lost, the viewer will try to re-connect indefinitely?
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: VNCViewer Command Line Switch

Post by Rudi De Vos »

This is what exist

" [/autoreconnect delayInSeconds]\r\n"
" [/reconnectcounter number_reconnect_attempt]\r\n"
AndyL
8
8
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Post by AndyL »

I tried that - doesn't seem to work. According to something else I read, I think that the autoreconnect is if you are using the viewer in listen mode?

-autoreconnect
Is used in conjunction with the -connect switch when having a server "back-connect" to a listening viewer. You can use it in a batch file for your clients that are behind a firewall that is not under your control. The batch file looks something like this:
"c:\program files\ultravnc\winvnc" -autoreconnect -connect 12.34.56.78
On the local computer run the viewer in "listening" mode, and have someone on the server end run the batch file. The -autoreconnect will make the server end attempt to reconnect to the listening viewer if the connection drops or is closed. It will immediately reconnect to the listening viewer if the session is closed. Close the listening viewer altogether in order to stop the server end from "autoreconnecting" to your computer. The server attempts to "autoreconnect" for only a few seconds.
Note that this "autoreconnect" param must be before the "connect" one on the command line!


Also, if you have a network disconnection, then a status screen pops up to tell you. This appears to be a modal screen, as you have to acknowledge it before you can do anything. Unfortunatly, this screen pops up behind the windows - well it does on Windows 10, anyway, so even if you could set a large number of retries, then it wouldn't be of any use, as the retries won't start until you click OK, and you can't click OK as the dialog is behind the display.

I'm trying to run the viewer for a customer as a kind of "kiosk" where it will sit all day displaying various statuses, full screen on a PC connected to a TV. If there is a network disconnect, or someone reboots the remote end, then the screen effectively freezes, because nothing will happen until the dialog box is acknowledged. Then you can see something has happened. I'd prefer that either the dialog popped up on top and automatically dismissed itself after a few seconds if the autoreconnect and reconnectioncounter values were specified so that it would give the chance for a reconnection to actually occur.

I'm using v 1.2.2.4 all round, on Windows 10 64 bit fully patched.
AndyL
8
8
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Post by AndyL »

I just tried the Real VNC viewer. That will automatically reconnect, and seems to work well with UltraVNC. But .... you can't put the password in on the command line. Rats.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: VNCViewer Command Line Switch

Post by Rudi De Vos »

viewer options

winvnc - connect 13.13.13.13
vncviewer /autoreconnect 60 /reconnectcounter 100000

vncviewer -listen
winvnc -autoreconnect -connect 13.13.13.12
AndyL
8
8
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Post by AndyL »

You still have to acknowledge the dialogue box that pops up behind the viewer, and when you do, the viewer eventually connects but then exits.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: VNCViewer Command Line Switch

Post by Rudi De Vos »

I'm missing something
viewer: listening or not
dialogbox that popups ? what box are you talking about

I can reboot my server without i need to logon again
viewer connect to server with autoreconnect.

Or do you mean that you try to logon before the server is active and you get a popup even before you are asked to enter the password

It isn't clear for me what you are actual trying to do
AndyL
8
8
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Post by AndyL »

Viewer - not in listening mode.
Here is my command line:

vncviewer.exe pcname -directx -nostatus -fullscreen -notoolbar -nohotkeys -quickoption 1 -password mypassword -autoreconnect 60 -reconnectcounter 100000

Connecting to server that is already running.
Display of remote PC is as expected.
Now disconnect network cable from PC with viewer running on it.
Message box pops up underneath viewer:

Window Title: VncViewer Message Box.
Title: Info Message
Text: Server closed connection
-Manual closed
-Network disconn

You cannot even ALT-TAB to the message box. You have to take the viewer out of full screen mode first.
Reconnection will not commence until this message box is dismissed.
Note that this box WILL pop up over the top of the viewer but NOT if you are in full screen mode.
Once the reconnection occurs, the viewer exits immediately.

If I'm doing something wrong, please let me know.

I have tried it with the RealVNC viewer with this command line:
vncviewer pcname username=myusername fullscreen=1 securitynotificationtimeout=0 monitor=2 viewonly=1

If you disconnect the cable, then the viewer shows an overlay over the top of the screen with an animation. When you plug the cable back in, it reconnects as expected.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: VNCViewer Command Line Switch

Post by Rudi De Vos »

Now disconnect network cable from PC with viewer running:
You can pull server cable or any hub between. But in our implemetation the viewer needs an active network.
The viewer try to reconnect, but no network hardware is found and this cause the popup.

There is no option for this.
AndyL
8
8
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Post by AndyL »

OK. Thanks for the clarification.
Post Reply