Install UVNC From Command Line or UVNC

UVNC is a great open source program for connecting to servers or PC’s. One of the major setbacks however is the difficulty in installing UVNC while connected with Remote Desktop, or RDP. The problem is it will run as the signed in user and even if you are signed into the console it still doesn’t seem to work right. Here are a couple of batch files I have written to uninstall UVNC and then another to reinstall UVNC. These can be used with a Remote Desktop (RDP) connection or through command line as well. To use these, simply copy the contents into a text file and save as UVNC-Uninstall.bat or UVNC-Install.bat.

UVNC-Uninstall.bat

@echo on
REM ~~~ uninstalling UVNC ~~~
“%ProgramFiles%\UltraVNC\unins000.exe” /SILENT /Y
“%ProgramFiles%\UltraVNC\unins001.exe” /SILENT /Y

 

UVNC-Install.bat

@echo on

REM ~~~ This Batch File will Install or Update UVNC ~~~

net stop uvnc_service
sc delete uvnc_service

cd "c:\program files\UltraVNC"

\\server\UltraVNC\UltraVNC_1_1_8_X86_Setup.exe /no restart /verysilent /loadinf="\\server\UltraVNC\UltraVNC_1_1_8_X86_Setup.exe" /log

copy \\server\UltraVNC\ultravnc.ini "c:\program files\ultravnc\ultravnc.ini" /Y

cd "%ProgramFiles%\UltraVNC\winvnc.exe"
"%ProgramFiles%\UltraVNC\winvnc.exe" -install

 

UVNC-install-64bit.bat

@echo on

REM ~~~ This Batch File will Install or Update UVNC ~~~

net stop uvnc_service
sc delete uvnc_service

cd “c:\program files\UltraVNC”

\\server\UltraVNC\UltraVNC_1_1_8_X64_Setup.exe /no restart /verysilent /loadinf=”\\50.58.140.108\software\tools\UltraVNC\UltraVNC_1_1_8_X64_Setup.exe” /log

copy \\server\UltraVNC\ultravnc.ini “c:\program files\ultravnc\ultravnc.ini” /Y

cd “%ProgramFiles%\UltraVNC\winvnc.exe”
“%ProgramFiles%\UltraVNC\winvnc.exe” -install

 

UVNC Command Line Paremeters

Running WinVNC

-service
Runs WinVNC as a service.
-servicehelper
Runs the WinVNC Service Helper app, i.e. the systray icon.
-run
WinVNC is being run as a user-level program.

Installing WinVNC as Windows service

-install
Installs WinVNC as a service.
-sinstall
Installs WinVNC as a service silently, i.e. no message box appears.
-remove
Removes the WinVNC service.
-reinstall
Silently removes WinVNC service, then re-installs it.

Accessing various Configuration Options

-settings
Shows the Properties dialog of an existing instance of WinVNC.
-defaultsettings
Show the Admin Properties dialog of an existing instance of WinVNC.
-multi
WinVNC is being run as a user-level program. Multiple simultaneous instances are allowed.
-fus
WinVNC is being run as a user-level program. Warning about multiple instances is disabled.
-about
Shows the About dialog of an existing instance of WinVNC.
-help

Connecting VNCViewers

-connect host[:display]
Adds a new client to an existing copy of winvnc.
Needs the computer name (DNS name) or IP address and optionally the display number (separated from the host name with a colon (:).
-connect host[::port]
Adds a new client to an existing copy of winvnc.
Needs the computer name (DNS name) or IP address and optionally the port number (separated from the host name with two colons (::).
-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!
-kill
Kills any already running copy of WinVNC.