The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Windows: editing the RLU list of vncviewer.exe

Posted by jpluimers on 2025/08/04

Every now and then you make a typo when accessing remote systems through UltraVNC  vncviewer.exe (I did the worst: thinking I had hit Enter to select the most recent connection, but typing a password instead).

I could not find settings in the registry, nor a vncviewer.ini file, so I used Process Monitor and filtered all events for the most recently started vncviewer.exe to figure out where it would store configuration files.

The VNC configuration files are all stored in %APPDATA%\UltraVNC and all have the extension .vnc though there is remarkably little information about them. Some is even wrong like [Wayback/Archive] VNC File Extension – What is a .vnc file and how do I open it? mentioning UltraVNC stores a file named latest.vnc.

Central configuration file

First of all, there is an options.vnc file in that directory, which on my system looks like this:

[connection]
index=AHBGDECF
F=192.168.1.58
C=192.168.1.156
E=192.168.2.56
D=192.168.3.23
G=192.168.2.57
B=192.168.24.38
H=Password
A=192.168.2.25

(Of course Password was not the password I used).

The value under the index key in the [connection] group specifies the order in the “VNC Server” selection drop down of vncviewer.exe in decreasing Most Recently Used order: A was used most recently, F least recently.

The values under single letter keys in the [connection] group contain VNC server references either by IP address (either IPv4 or IPv6) or hostname.

Per VNC Server configuration file

The rest of files in the directory consists of per VNC Server configuration files named HOSTNAME-portnumber.vnc where the (always UPPERCASE!) HOSTNAME is the same as in the options.vnc and portnumber by default is 5900.

For example 192.168.3.23-5900.vnc (for VNC Server with letter D) looks like this

[connection]
host=192.168.3.23
port=5900
proxyhost=
proxyport=0
[options]
use_encoding_0=1
use_encoding_1=1
use_encoding_2=1
use_encoding_3=0
use_encoding_4=1
use_encoding_5=1
use_encoding_6=1
use_encoding_7=1
use_encoding_8=1
use_encoding_9=1
use_encoding_10=1
use_encoding_11=0
use_encoding_12=0
use_encoding_13=0
use_encoding_14=0
use_encoding_15=0
use_encoding_16=1
use_encoding_17=1
use_encoding_18=1
use_encoding_19=1
use_encoding_20=0
use_encoding_21=0
use_encoding_22=0
use_encoding_23=0
use_encoding_24=0
use_encoding_25=1
use_encoding_26=1
use_encoding_27=1
use_encoding_28=0
use_encoding_29=1
preferred_encoding=10
viewonly=0
showtoolbar=1
fullscreen=0
SavePos=0
SaveSize=0
directx=0
autoDetect=0
8bit=0
shared=1
swapmouse=0
emulate3=1
JapKeyboard=0
disableclipboard=0
Scaling=0
AutoScaling=0
AutoScalingEven=0
AutoScalingLimit=0
scale_num=1
scale_den=1
cursorshape=1
noremotecursor=0
compresslevel=6
quality=8
ServerScale=1
Reconnect=3
EnableCache=0
EnableZstd=1
QuickOption=1
UseDSMPlugin=0
UseProxy=0
allowMonitorSpanning=0
ChangeServerRes=0
extendDisplay=0
showExtend=0
use_virt=0
useAllMonitors=0
requestedWidth=0
requestedHeight=0
DSMPlugin=NoPlugin
folder=C:\Users\test\Documents\UltraVNC
prefix=vnc_
imageFormat=.jpeg
InfoMsg=
AutoReconnect=3
FileTransferTimeout=30
ThrottleMouse=0
KeepAliveInterval=5
AutoAcceptIncoming=0
AutoAcceptNoDSM=0
GiiEnable=0
RequireEncryption=0
restricted=0
nostatus=0
nohotkeys=0
sponsor=0
PreemptiveUpdates=0
AllowUntrustedServers=0

I could not find any documentation on these. The only relevant information I could find was in the repository [Wayback/Archive] ultravnc/UltraVNC: UltraVNC Server and UltraVNC Viewer | Official repository: https://github.com/ultravnc/UltraVNC:

The odd thing is that none of the constants are in VNCOptions.h (it contains only the declaration of the VNCOptions class.

All hard-coded stuff is in VNCOptions.cpp including options.vnc including duplicate use of "\\options.vnc" .

Files using the VNCOptions class are these (using various names referring to VNCOptions: m_opts, optspOpt:

The files have five mostly identical copies of code like sprintf_s(fname, "%.15s-%d.vnc", m_host_dialog, (disp > 0 && disp < 100) ? disp : m_port confirming the per VNC Server configuration filename.

Comments in the files are sparse. I found no real explaining comments. It would not be a codebase I would like to maintain.

Deleting a LRU entry

Steps:

  • delete the VNC Server configuration file and remember the hostname of it
  • in options.vnc, remove the key line that belongs to the above hostname and remember the key letter
  • in options.vnc, remove the key letter from the index entry
  • if there are gaps in the sequence of keys, then move them down in both the key entries and the  index (for instance if D is missing, move E to D, then continue with the gap E until you are done)

Queries

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.