JSI Tip 0086 - How do I schedule a service (such as RAS) to start and stop?

Jerold Schulman

March 19, 1997

1 Min Read
ITPro Today logo

You can use the AT command (or a good scheduler such as OpalisRobot) to schedule a batch file that contains a net start and/or net stop.

Here is an example of scheduling RAS to stop at 23:00 and start up at 04:00

AT \ServerName 23:00 /interactive /every:M,T,W,Th,F,S,Su cmd.exe /c "Drive:DirectoryRASSS.bat"

where RASSS contains:

net stop RemoteAccess
sleep 18000
net start RemoteAccess
Exit

Note 1: RemoteAccess is the actual service name. To determine the service name, scan the registry at HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices

Note 2: Sleep is a Resource Kit utility. If you don't have it and can't afford it, schedule the net start as a separate job.


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like