Tue May 12 14:35:28 BST 2009
new avenue for you. I'll give a brief summary here (for fear of
exasperating experienced scripters). If you want more information, contact
"Scripting" simply means storing a series of commands in a file and then
running the file in one go. It's a close cousin to "programming" - loosely,
programs are normally converted into a binary program by a "compiler", while
scripts are usually "interpreted" line by line by some other running
There are several "interpreters" available for Windows NT and its
descendents. If you click Start, Run, then type CMD and click OK you'll get
the familiar DOS-like command interpreter. With a few adjustments, anything
you type in there can be stored in a script and run. If you put the
following lines in a text file:
.. and save that as mytest.cmd (not mytest.txt) you can double-click it and
you'll see the black window appear with the output of the DIR command (which
lists files) and a line inviting you to press any key to continue (at which
point the screen disappears, which is why many of my scripts end with
PAUSE!). If you Google for "NT Command Line" or "NT Command Scripting"
you'll find loads of resources, and I rather like the book on NT Shell
Scripting by Tim Hill (Macmillan 1998). I tend to use plain NT scripting
for simple scripts.
Other "interpreters" include "Windows Scripting Host" (usually already
installed as part of Windows) which can interpret Visual Basic Script (VBS)
commands, which are much more powerful than the rather creaky NT
command-line interface. I tend to use VBS for more complex scripts, as the
error-handling in NT scripting is rudimentary. VBS can also interact with
Excel and other Office programs in a sophisticated way.
More recently another interpreter has become available, and this promises
something like the (awesome and underused) power of Unix scripting:
PowerShell. Non-trivial, but immensely powerful. Some of Microsoft's
flagship server products are expected to be administered mainly by
Powershell scripting in their most recent versions. I got through two
chapters of the book (still next to my workstation) before other work blew
How does this affect RealVNC users? Well, I provide the people I support
with a simple script which they click to connect to my "listening client".
I've set up port-forwarding at my end to allow port 5500 through to my
preferred machine, and all Uncle Joe has to do to get my help is
double-click the script's icon on their desktop. The advantage of this
arrangement is that I can deal with firewall problems at my end without
having to get them to fiddle with such mysteries at their end - it just
works. I think it would also be possible to create a script which would
check regularly for a working connection and reconnect if none existed, but
that's for another day/month/year.
In the past (XP and earlier) I've used a script which pops up an explanatory
message box first (giving the option to cancel in case of a finger-fumble),
then checks for a running server and then connects to my hard-coded address.
I'll be happy to send you (or anyone else interested) a copy of this on
request. The essential line is:
WinVNC4.exe -connect <phils-domain-address>
.. where phils-domain-address is a domain name provided by my ISP, although
an IP address will do. If you have a dynamic IP address, you can use
DynDNS.com (free) to set up a domain name which will track your changing IP
address (assuming you run the update client on at least one running
My original question was about Vista. I've found that including the term
"-service" in the line above allows the connection to work (in the
configurations I've set up), but I need to modify my script to check whether
a server is running as a service or in user-mode, or not at all.
Nevertheless, if you get the person needing support to check manually if the
server is running (task manager or spot the icon) then that one line may be
all you need in a simple script. Lord knows when I'll get round to doing
the modification to my script, but I doubt it'll turn out to be any more
difficult than what worked well for XP.
I must say that the documentation for Command Line use of RealVNC is rather
inadequate (or is it just hard-to-find?).
Hope that's useful.
Philip Herlihy, London
Behalf Of Dale Eshelman
Sent: 21 June 2009 06:11
To: Philip Herlihy
Subject: Re: Command-line connection to listening client from Vista machine?
I would be interested to know how to create a script in WXP Pro as I
have never done it.
Can you provide more information on how to create a script to use and
how then to use the script?
On Jun 20, 2009, at 8:10 AM, Philip Herlihy wrote:
> On XP machines I've set up a script which invokes a connection to a
> listening client:
>> vinvnc4.ext - connect MyClientHost.MyDomain.com
> - very useful. This doesn't work on Vista. Can anyone advise on
> how I'd do
> the equivalent from a command-line or command-file? The Vista box
> has VNC
> running as a service.
> Phil, London