[SunHELP] Script to stop NT service

Sheldon T. Hall shel at cmhcsys.com
Sat Feb 8 11:38:06 CST 2003


"Kurt Huhn" <kurt at k-huhn.com> writes ...

> "Sheldon T. Hall" <shel at cmhcsys.com> wrote:
>
> > More seriously, I suppose you could use `expect` to simulate an
> > interactive session on the Unix box, having it log in to the telnet
> > server on the NT box and issue whatever command-line commands it takes
> > to stop a service.  You can get `expect` and the supporting stuff for
> > it from www.sunfreeware.com.
> >
>
> Do the samba client stuffs have an equivilent of the "net" command?  You
> can start and stop services on remote NT servers (form other NT servers)
> using "net stop //server/servicename" or something similar (my NT
> knowledge is very rusty).

I don't see any "net" command in the Samba doco, except the part about how
to connect to Samba from a Windows machine.  I.e. it's gioving you the
Windows commands.

Worse, though, is the statement under the NET STOP command ... "Services
cannot be stopped from a command prompt within Windows."  HOWEVER, dropping
to a command prompt on my Win2K laptop and entering "NET STOP /?" gets me
"The format of this command is NET STOP service" so it looks like the book
may be wrong, at least as far as Win2K goes.

If "NET STOP service" works from a command line, and if the NT 4 telnet
server lets you have a command line, it seems that an `expect` script ought
to work.  But that's a few "ifs" ...

-Shel


More information about the SunHELP mailing list