The Sysadmin Wiki

Simple remote connection on Windows[]

This is a remote desktop setup with VNC, where the user only needs to double-click a connect.bat file in order to request a remote desktop connection. It installs a display driver for you to ensure more optimal throughput (only transmits parts of the screen that are changed).

Usual disclaimer: No guarantees. Please share experiences. It works on Windows XP SP2 setups. I have had reports that it worked on Vista, albeit it might have needed some permission/firewall tweaks.

I wasn't sure how licenses were for the different applications, so i wanted to start with references to what's needed and only supply a howto guide. I might package some of the stuff, if i gather info on all of the licenses.

Client setup[]

  • Make a folder for the helpdesk application (e.g. c:\helpdesk) and a subfolder for the dependencies (e.g. c:\helpdesk\program)
  • Extract winvnc.exe and VNCHooks.dll from the TightVNC set of executables (don't need the installer) into the c:\helpdesk\program folder
  • Download the DFMirage driver (dfmirage.exe) into the c:\helpdesk\program folder
  • Extract sleep.exe from the Windows Server 2003 Resource Kit Tools into the c:\helpdesk\program folder
  • Make a c:\helpdesk\program\setup.reg file with the following contents:
Windows Registry Editor Version 5.00

  • Make a c:\helpdesk\connect.bat with the following contents:
@echo off

rem Setup if necessary
if exist "%userprofile%\.dfmirage" goto mirageok
regedit /e "%userprofile%\.dfmirage" "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dfmirage"
if exist "%userprofile%\.dfmirage" goto mirageok
echo Setting up connection for first use...
program\dfmirage.exe /sp- /verysilent /norestart
if exist "%userprofile%\.vnc" goto vncok
regedit /e "%userprofile%\.vnc" "HKEY_CURRENT_USER\Software\ORL\WinVNC3"
if exist "%userprofile%\.vnc" goto vncok
regedit /s program\setup.reg
echo Done.

echo Connecting...
program\winvnc -kill
start program\winvnc -run
program\sleep -m 500
program\winvnc -connect %address%

Host setup[]

For the person that wants to take over the other computer (the sysadmin), you merely need to start any VNC viewer (perhaps TightVNC), with the -listen argument:

vncviewer -listen

External links[]