A command-line tool for controlling WINS servers

At two recent conferences, I gave a presentation that covers how Windows Internet Naming Service (WINS) and Domain Name System (DNS) work. Attendees of both talks asked me, "How can I delete a specific record from a WINS database?" and "How can I dump a complete list of WINS registrations to an ASCII file?"

The graphical WINS manager that ships with NT can't perform either of these jobs, but a utility called winscl.exe, which comes with Microsoft Windows NT Server 4.0 Resource Kit and Microsoft Windows NT Server 3.51 Resource Kit, can.
WINSCL offers much of the same functionality as the graphical WINS manager, and it provides a few functions the GUI program doesn't offer.

Despite its power, WINSCL can be frustrating. I'm not exaggerating when I say that it makes Edlin's user interface (UI) look friendly. To start WINSCL, you type

winscl

on a command line, and the utility greets you with

TCP/IP or named pipe. Enter 1 for TCP/IP --

WINSCL is asking you to specify whether you want to enter an IP address or NetBIOS name to identify the WINS server you want to use WINSCL to control. If you enter 1, WINSCL will ask for the server's IP address (such as my WINS server's address, 10.10.10.21). If you enter 0, it'll ask for the machine's Uniform Naming Convention (UNC) name, which is your cue to enter the server's name preceded by two backslashes (e.g., \\WINS01).

After you select a server, WINSCL produces a description of each of its 31 commands. By default, it lists all 31 commands after it completes every job. If you enter the NOME (no menu) command, WINSCL won't display its menu of commands again until you exit and restart the utility. Another WINSCL quirk is that you must capitalize all commands.

WINSCL Commands
WINSCL's two most useful commands are DN (delete name) and GRBV (get records by version numbers). DN helps you clean out a WINS database. GRBV lets you dump all of a WINS server's records to an ASCII file.

Several months ago, someone registered with my WINS server as JOE<03>. I used WINSCL to remove Joe from the WINS database. My dialog with my WINS server follows.

Command -- DN

Name? JOE

Do you want to input a 16 char (1 for yes) -- 1

16th char in hex -- 03

Scope -- 1 for yes -- 0

Status returned is (SUCCESS -- 0)

The other useful WINSCL command, GRBV, lets you extract WINS records for storage in an ASCII file based on the records' version numbers, the Microsoft term for the order in which they were created. (The first WINS record that a WINS database creates is version number X, the next record's version number is X+1, and so on.) GRBV is convenient, but it doesn't give up the data easily. You get a bit of interrogation along the way, as the following dialog demonstrates.

Command -- GRBV

Address of owner WINS? 10.10.10.21

Want to specify range -- (input 1) or all (default) -- 0

Use filter (1 for yes) -- 0

Put records in wins.rec file (1 for yes) -- 1

Status returned is (SUCCESS -- 0)

If this example looks like too much work, you can create an ASCII text file to automatically answer WINSCL's questions. Enter one answer per line for the WINSCL dialog. For example:

1

10.10.10.21

GRBV

10.10.10.21

0

0

1

EX

EX is the command to exit WINSCL. Name your ASCII file WINSIN.TXT, and invoke it by typing

WINSCL

The text dump process will run automatically.

Have fun playing with WINSCL, but don't bother trying to use the CR (count records) command. CR makes WINSCL crash every time.