Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


January 2001

Remotely Control Any NT Machine

RSS
Subscribe to Windows IT Pro | See More Windows NT 4.0 Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

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.

End of Article



Reader Comments
This is phenomenal

Joshua February 14, 2001


Altough this process got me very excited, it has an issue with the password for the session. I could not find a way to set up the 1st time password for the 1st session on the remote VNC server. Maybe someone know how to set a pre-defined password for the session? I tried using a blank password but the VNC won't let me since this is a security breach.

Ronen Shurer March 12, 2001


OK. it's quite easy to set up a password for the first session. You should type command, which looks like that
net use \\computername\share "password" (type your password of course) /:username

marcin April 03, 2001


I agree to set the first session password is not possible unless I am missing something. I set a password on my test machine and input this registry entry into the remote machines the binary values matched however I still got a VNC session failure. The net use command posting doesn't make sense to me. How is a net use command going to set a session password in VNC? Any ideas?

Jay R. Pascarella May 03, 2001


I have found this information to be very useful. Thanks for sharing it with the rest of us!

Kevin Hartle June 14, 2001


I also have been unable to get this idea to work because it doesn't seem possible to set the first session password. The VNC web site mentions a registry entry "AuthRequired = REG_DWORD 0x00000000" which is supposed to allow a null password but I have yet to figure out how it works. Has anyone been able to make this work without modifing the target machine?

Larry September 18, 2001


Hi, all, you may try follow this
First of all, try install one copy vnc on your local machine and set the password properly. You will need
1. REG.EXE
2. SHUTDOWN.EXE
From NTRK4.0

Then follow this

NET USE \\<<Remote IP>>\IPC$ /user:<<Administrator User Name>>

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

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

REM Create winvnc service subkey in order to restore it
REG ADD HKLM\System\CurrentControlSet\Services\winvnc \\<<Remote IP>>

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

REM Backup the current machine ORL software registry
REG BACKUP HKLM\SOFTWARE\ORL ORL

REM Create the ORL subkey (in order to restore it)
REG ADD HKLM\SOFTWARE\ORL \\\\<<Remote IP>>

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

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

James Pua September 25, 2001


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

NET USE \\<<Remote IP>>\IPC$ /user:<<Administrator User Name>>

REM Copy Everything there...
XCOPY C:\"Program Files"\ORL\*.* \\<<Remote IP>>\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 \\<<Remote IP>>\C$\WINNT\SYSTEM32
REM Create winvnc service subkey in order to restore it
REG ADD HKLM\System\CurrentControlSet\Services\winvnc \\<<Remote IP>>

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

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 \\<<Remote IP>>\C$\WINNT\SYSTEM32
REM Create the ORL subkey (in order to restore it)
REG ADD HKLM\SOFTWARE\ORL \\<<Remote IP>>

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

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

James Pua September 26, 2001


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.

Deepak Kalra April 12, 2002


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.

Eric March 09, 2004


 See More Comments  1   2 

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

How can I stop and start services from the command line?

...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing