Subscribe to Windows IT Pro
December 20, 2000 12:00 AM

Remotely Control Any NT Machine

Windows IT Pro
InstantDoc ID #16162
Rating: (1)
Downloads
16162.zip

Imagine the following situation: You have a Windows NT server that is physically inaccessible but reachable by TCP (e.g., it's in a remote office). You have the Administrator account for the machine, but you can't accomplish the task you need to perform using the standard NT management tools. In addition, the remote system doesn't have a remote control program installed. In this situation, you can install AT&T Laboratories Cambridge's Virtual Network Computing (VNC), a freeware remote control tool, without physically accessing the machine.

You'll need to complete a few steps to set up and use the tool. First, determine the Administrator password of the remote machine. Next, download the VNC distribution from http://www.uk .research.att.com/vnc and make sure you have the Microsoft Windows NT Server 4.0 Resource Kit Regini tool and the Shutdown and Netsvc tools.

After you download the VNC distribution, extract the VNC files from the distribution package. The simplest way to accomplish this task is to install VNC on a test machine. The installation automatically creates the C:\program filesorl\vnc directory, which includes all but one of the files that you need to run VNC. The missing file is omnithread_ rt.dll, and you can find it in the \winntsystem32 directory. Copy the missing file to the C:\program files\orl\vnc directory.

Next, use the following commands to copy the VNC directory to the target machine:

NET USE \\<remote machine IP>
\IPC$ /user:administrator password

MKDIR "\\<remote machine IP>
\C$\program files\orl\vnc"

COPY "c:\program files\orl\vnc" "\\<remote machine IP>
\C$\program files\orl\vnc"

For VNC to successfully run, you'll also need to create registry entries on the target machine. To load the remote target machine's registry, use the following command:

REGINI -m \\<remote machine IP> vnc.regini

Listing 1, page 28, shows vnc.regini. The Regini command registers VNC as an automatic startup service on the remote machine. In addition, it sets the default VNC password as the remote machine's password.

The final step is to start the VNC on the remote server. You can use two methods to start VNC on the remote machine: You can use the At command to schedule VNC to start, or you can use Shutdown.exe to force a shutdown. The At method is less disruptive but requires the Scheduler service to be running on the remote system. The Scheduler service isn't started by default, so you might need to use the following command to start it manually:

NETSVC \\<remote machine IP> schedule /start

To use the At method to schedule VNC to start, execute the following command to read the time on the remote server:

NET TIME \\<remote machine IP>

Then, schedule an At command to run a couple of minutes after the time that the previous command returned, as the following example shows:

AT \\<remote machine IP> 00:00 "c:\program files\orl\vnc
\winvnc.exe"

Wait a few minutes and launch vncviewer.exe to connect to the remote machine.

As a last option, you can use the Shutdown command to remotely reboot the server:

SHUTDOWN \\<remote machine IP>
 /R /Y /C /T:0

This command brings up VNC listening as a service.

Related Content:

ARTICLE TOOLS

Comments
  • Dawgma
    7 years ago
    Nov 11, 2005

    If you don't feel like messing with scripting to do this, just download http://www.vncscan.com and deploy away! It has support for things that would take FOREVER to script by hand all of the time.

  • Anonymous User
    8 years ago
    Dec 14, 2004

    I found another site describing how to change the default password. This is different than just going to the vnc server properties and setting the password there. That is setting the "user" password. To set the "default" password, open a command prompt locally and go to the vnc server directory (the one with the server executable not the viewer executable). Then type "winvnc -defaultsettings" (or different executable if using different version of vnc). This window will look just like the server properties sheet, but will indicate that it is the default settings on the menu. This will update the registry accordingly. Now import those registry settings on the remote machine.

  • Eric
    8 years ago
    Mar 09, 2004

    I never tried to install vnc remotely but MAY BE it is possible to use psexec instead of AT command or shutdown. psexec is a program which allow code execution on a remote machine.

  • Deepak Kalra
    10 years ago
    Apr 12, 2002

    After you have scheduled the winvnc.exe to run at particular time, it will not be having any password and if you try to connect it says 'This server does not have a valid password enabled. Until a password is set, incoming connections can not be accepted.

  • James Pua
    11 years ago
    Sep 26, 2001

    The previous post has one missing steps, this is the correct one

    NET USE \\\\<>\\IPC$ /user:<>

    REM Copy Everything there...
    XCOPY C:\\"Program Files"\\ORL\\*.* \\\\<>\\C$\\"Program Files"\\ORL\\ /S

    REM Backup the current machine vnc service registry
    REG BACKUP HKLM\\System\\CurrentControlSet\\Services\\winvnc winvnc

    REM Copy the backup registry file to remote machine
    COPY winvnc \\\\<>\\C$\\WINNT\\SYSTEM32
    REM Create winvnc service subkey in order to restore it
    REG ADD HKLM\\System\\CurrentControlSet\\Services\\winvnc \\\\<>

    REM Retore it
    REG RESTORE winvnc HKLM\\System\\CurrentControlSet\\Services\\winvnc \\\\<>

    REM Backup the current machine ORL software registry
    REM This is where VNC place the password
    REG BACKUP HKLM\\SOFTWARE\\ORL ORL

    REM Copy the backup registry to remote machine
    COPY ORL \\\\<>\\C$\\WINNT\\SYSTEM32
    REM Create the ORL subkey (in order to restore it)
    REG ADD HKLM\\SOFTWARE\\ORL \\\\<>

    REM Restore it
    REG RESTORE ORL HKLM\\SOFTWARE\\ORL \\\\<>

    SHUTDOWN \\\\<> -R -T:3

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.