[RC5] NT 4.0 service client - auto start/stop?

Brian Renken Brian_Renken at SensArray.com
Wed Jul 14 17:14:45 EDT 1999


Neil Muspratt <neil at gargoyle.apana.org.au> wrote:

> I can start/stop the clients remotely from my PC with the NETSVC.EXE
> command line utility (part of the NT 4.0 Resource Kit) but this only
> works interactively - I can't automate the process using a batch file
> executed by the AT scheduler. I guess this is because AT doesn't have
> admin privileges when it runs programs.

Use the following batch file:
-------------------
rem Add a 'call :action machinename' for each machine you want to start
call :action bismark
call :action titanic
goto :eof

:action
rem Replace the various fields in the next line with your info.
rem Unfortunately the password will be in clear text, so keep your machine
secure.
net use z: \\%1\c$ /U:Domainname\Username password
netsvc \\%1 /start rc5
net use z: /delete
goto :eof
---------------------------
By executing the net use command with your name and pass, you open a
privileged connection so the following NETSVC command will work. It adds a
slight overhead, but it works.

I have a second batch file with netsvc /stop.

You can debug your batch job by running
AT hh:mm /interactive "cmd.exe /k"
from a command line.  Close the existing command prompt and run your batch
job from the window that opens. This should let you see what is happening
within the context of the schedule service account.  You may need to add
ECHO and PAUSE commands to some batch files to effectively debug them.

Visit http://www.jsiinc.com/default.htm?/reghack.htm for other NT tips.
(I'm not affiliated with the site, just a satisfied user.)

Regards,
Brian Renken

***
I eat my coffee straight from the can.  Why dilute it?

--
To unsubscribe, send 'unsubscribe rc5' to majordomo at lists.distributed.net
rc5-digest subscribers replace rc5 with rc5-digest



More information about the rc5 mailing list