VNCViewer Command Line Switch

Here you will find help for frequently asked questions as well as for your specific question.

VNCViewer Command Line Switch

Postby AndyL » 2019-07-07 13:04

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?
AndyL
8
8
 
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Postby Rudi De Vos » 2019-07-07 21:33

This is what exist

" [/autoreconnect delayInSeconds]\r\n"
" [/reconnectcounter number_reconnect_attempt]\r\n"
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5909
Joined: 2004-04-23 10:21

Re: VNCViewer Command Line Switch

Postby AndyL » 2019-07-08 07:06

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

Postby AndyL » 2019-07-08 14:29

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.
AndyL
8
8
 
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Postby Rudi De Vos » 2019-07-08 15:25

viewer options

winvnc - connect 13.13.13.13
vncviewer /autoreconnect 60 /reconnectcounter 100000

vncviewer -listen
winvnc -autoreconnect -connect 13.13.13.12
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5909
Joined: 2004-04-23 10:21

Re: VNCViewer Command Line Switch

Postby AndyL » 2019-07-09 12:30

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.
AndyL
8
8
 
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Postby Rudi De Vos » 2019-07-09 20:57

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
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5909
Joined: 2004-04-23 10:21

Re: VNCViewer Command Line Switch

Postby AndyL » 2019-07-11 05:16

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.
AndyL
8
8
 
Posts: 9
Joined: 2012-12-17 15:58

Re: VNCViewer Command Line Switch

Postby Rudi De Vos » 2019-07-11 17:00

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.
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5909
Joined: 2004-04-23 10:21

Re: VNCViewer Command Line Switch

Postby AndyL » 2019-07-12 04:04

OK. Thanks for the clarification.
AndyL
8
8
 
Posts: 9
Joined: 2012-12-17 15:58


Return to General help

Who is online

Users browsing this forum: No registered users and 9 guests