This article contains an older method for installing VNC on a remote PC
To read about the newer method, click here


How to install VNC on a remote PC

VNC is a free utility to remotely control another PC, see http://www.realvnc.com for details.
This article assumes that the remote PC is running Windows NT4, 2000, 2003, or XP Pro (XP Home does not have an IPC$ share as far as I know).

Section I: Install VNC locally, configure the service, and set the password.

Note: The batch file below was for older versions. It doesn't really matter how VNC gets installed on the local PC, just make sure that a password is set and that it is able to take incoming connections.

The following batch file automates this process. Start it in the same directory where VNC's setup.exe is located.
Echo Install VNC
Setup.exe
Echo.
pause
Echo Installing VNC service
"C:\Program Files\ORL\VNC\WinVNC.exe" -install
Echo.
pause
Echo Starting VNC service
net start "VNC Server"
Echo.
Echo You will be prompted to set a VNC password
Echo.
Echo When you hit enter, VNC installation will be complete
pause

Section II: Install VNC on the remote PC *without* Resource Kit Utilities

You may need one publicly available utility: psshutdown.exe from http://www.microsoft.com/technet/sysinternals/utilities/psshutdown.mspx
Note: \\RemotePC mentioned below can be either the remote PC's name or IP address.
  1. Login to the remote PC's IPC$ share with an administrator account.
    If you don't include the password in plain text, you will be prompted to supply the password (which will not be displayed as plain text).
    NET USE \\RemotePC\IPC$ /user:administrator password


  2. Copy your local VNC files to the remote PC.
    xcopy "C:\Program Files\ORL\VNC\*.*" "\\RemotePC\c$\Program Files\ORL\VNC\*.*" /r/i/c/h/k/e


  3. Use Regedit to export the VNC registry entries on your PC.
    regedit /e "C:\vncdmp.reg" "HKEY_LOCAL_MACHINE\Software\ORL"
    regedit /e "C:\vncdmp2.reg" "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\winvnc"


  4. Copy vncdmp.reg and vncdmp2.reg to the remote PC (manually consolidate to a single entry if you want).
    Copy C:\vncdmp*.reg \\RemotePC\c$\*.*.

  5. Get the time on the remote PC
    NET TIME \\RemotePC


  6. Use the local AT command to have the Task Scheduler service on the remote PC execute commands. This service should be started by default, but you can confirm by running AT \\RemotePC.
    AT \\RemotePC hh:mm regedit /s C:\vncdmp.reg
    AT \\RemotePC hh:mm regedit /s C:\vncdmp2.reg
    AT \\RemotePC hh:mm "c:\program files\orl\vnc\winvnc.exe" -service


  7. Notes:
    1) Make sure to schedule the AT commands to run after the time that net time returned.
    2) Use the /s switch with regedit.
    3) To confirm that entries correctly executed, run AT \\RemotePC after the scheduled time has passed.

  8. Now all you need to do is reboot the remote PC.
    You can try to shutdown the PC using Compmgmt.msc (assuming you make a remote connection) and the Advanced tab under properties. See http://www.jsiinc.com/sube/tip2200/rh2207.htm for details.
    If the above doesn't work, try psshutdown.exe.
    psshutdown.exe \\RemotePC -f -r -t 20 -m "*WARNING* This PC will force reboot in 20 seconds"

When the PC has booted back up, you should be able to connect using VNC. Please note that I have only tried this once from a Windows 2000 PC to a Windows XP Pro PC.  Also, I tried connecting to the remote PC with regedit and importing the appropriate settings, but was unable to do it. Since you have to use the AT command anyway to install the VNC service, I think the above method is good enough for now.

If you have any suggestions or comments, please send them to webadmin@tburke.net

Section III: Install VNC on the remote PC with Resource Kit Utilities

You will need 4 resource kit utilities: regdmp, regini, netsvc, and shutdown
  1. Login with an administrator account to the remote PC's IPC$ share.
    If you don't include the password in plain text, you will be prompted to supply the password (which will not be displayed as plain text).
    NET USE \\RemotePC\IPC$ /user:administrator password


  2. Copy your local files to the remote PC
    xcopy "C:\Program Files\ORL\VNC\*.*" "\\RemotePC\c$\Program Files\ORL\VNC\*.*" /r/i/c/h/k/e


  3. Use regdmp to export the VNC registry entries on your PC into a format useable by regini
    regdmp "HKEY_LOCAL_MACHINE\SOFTWARE\ORL" >c:\vncdmp.txt
    regdmp "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\winvnc" >>c:\vncdmp.txt


  4. Use regini to import the entries from step 3 into the remote PC.
    REGINI -m \\RemotePC C:\vncdmp.txt


  5. Start the schedule service on the remote PC (the service may already be started)
    NETSVC \\RemotePC schedule /start


  6. Get the time on the remote PC
    NET TIME \\RemotePC


  7. Use the At command to schedule VNC to start (schedule it to run after the time that net time returned).
    AT \\RemotePC hh:mm "c:\program files\orl\vnc\winvnc.exe" -service

  8. Use the shutdown command to reboot the remote PC
    SHUTDOWN \\RemotePC /R /C /T:5
When the PC has booted back up, you should be able to connect using VNC. http://www.win2000mag.com/Articles/Index.cfm?ArticleID=16162 served as the inspiration for this. The above method differs in that you are using regdmp to create the regini entries yourself. The VNC defaults set on your PC will be used on the remote PC, including your VNC password.


07/29/03: Added Section II and corrected quote placement for "c:\program files\orl\vnc\winvnc.exe" -service