Page 1 of 1 1
Topic Options
#118277 - 2004-04-20 12:17 AM How to I start/stop a W2K service using KIX?
Lee Offline
Fresh Scripter

Registered: 2004-04-20
Posts: 8
I need to automatically start and stop a service, does anybody know how to do it using KIX commands?

Thanks,
Lee

Top
#118278 - 2004-04-20 12:24 AM Re: How to I start/stop a W2K service using KIX?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Lots of ways to do this. Could use WMI and the WMIService UDF, or could do it with ADSI, or could do it by shelling out to NET START or by using the SC reskit utility, or even the XNET utility that comes with Kixtart ... whats your pleasure ?

-Shawn

Top
#118279 - 2004-04-20 12:59 AM Re: How to I start/stop a W2K service using KIX?
Lee Offline
Fresh Scripter

Registered: 2004-04-20
Posts: 8
Hi Shawn, Thanks for the reply, I could do it with the NET STOP/START command, but I am not confident with DOS coz it hangs sometimes and I prefer using kix.

Can you give me an example using the XNET command?

Thanks a lot!

Top
#118280 - 2004-04-20 01:24 AM Re: How to I start/stop a W2K service using KIX?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Hey Lee...

If the service hangs when being stopped/started then it's probably a problem with the service, not DOS. I'm not sure any method would get you around that. But XNET.exe is pretty easy to use.

Shell '%comspec% /c xnet.exe Start Spooler'

would start the spooler service...

Shell '%comspec% /c xnet.exe Stop Spooler'

would stop the spooler service...

There are many other options using xnet.exe...Just type xnet.exe /? at a command and it will list all possible parms.

Top
#118281 - 2004-04-20 01:28 AM Re: How to I start/stop a W2K service using KIX?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
And to use Net Stop/Start from within Kix you can do..

Shell '%comspec% /c net stop spooler'

Which would stop the print spooler service.

Top
#118282 - 2004-04-20 04:18 AM Re: How to I start/stop a W2K service using KIX?
Lee Offline
Fresh Scripter

Registered: 2004-04-20
Posts: 8
Thanks guys! Your inputs will definitely help me automate the task.

Lee

Top
#118283 - 2004-04-20 05:20 AM Re: How to I start/stop a W2K service using KIX?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
If you would look into the UDF Forum there are actually a multitude of UDSFs that perform actions on services via different OS functionality.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.039 seconds in which 0.016 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org