Page 1 of 1 1
Topic Options
#150327 - 2005-10-20 05:28 PM How to stop and remove a service on a NT4 workstation
yellowdog Offline
Starting to like KiXtart

Registered: 2005-06-14
Posts: 102
What is the code to remove and stop a service in kixtart.

Thanks for the answer

Top
#150328 - 2005-10-20 05:47 PM Re: How to stop and remove a service on a NT4 workstation
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
For NT, without WMI, I'd use the XNET.EXE command distributed with Kix prior to version 4.5
Code:
 
Shell 'XNet Remove "\\server\servicename" /y'


The server name is optional, and will default to the local system.

Of course, that's a code fragment - you should check for errors and maybe even verify that the service is present before you try to remove it. Make sure to specify the path to the xnet command if it isn't in your PATH statement.

If you want to stop it - replace the "remove" with "stop".

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#150329 - 2005-10-20 05:50 PM Re: How to stop and remove a service on a NT4 workstation
yellowdog Offline
Starting to like KiXtart

Registered: 2005-06-14
Posts: 102
Thanks for such a fast answer.
It's useless to stop the service before removing it? Right.

Top
#150330 - 2005-10-20 05:58 PM Re: How to stop and remove a service on a NT4 workstation
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Nope - If you don't stop it, it may continue to run, and could hold files open, preventing the removal of the binaries.

Stop the service, then remove the service, then perform any cleanup of the service files.

BTW - XNET LIST \\server\service name will display the location of the service binary (executable).

My SvcCtl() UDF uses XNET to start/stop or enable/disable services. SvcList() will return all the services, or an array of a single service's detail.

Check the UDF forum, or download the latest copy from the Kix Development page on my web site. It's part of the library included in the Zip file.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#150331 - 2005-10-20 06:16 PM Re: How to stop and remove a service on a NT4 workstation
yellowdog Offline
Starting to like KiXtart

Registered: 2005-06-14
Posts: 102
Last question about this topic.
What is the syntax to remove a service with a service name containing blanks in the name ???
For instance: XNET remove \\MACHINE\My Service to remove

It doesn't sounds to work............

Top
#150332 - 2005-10-20 06:25 PM Re: How to stop and remove a service on a NT4 workstation
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
The service name must be enclosed in quotes. Notice the embeded quotes above - single quotes for the SHell command, and double-quotes around the service name.

Try an XNET LIST on that target server, most services have a "short name", which - per MS specs - should NOT have spaces in the name. Unfortunately, not all vendors adhere to this rule (Symantec & Macromedia come to mind)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#150333 - 2005-10-25 03:28 PM Re: How to stop and remove a service on a NT4 workstation
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
One could also remove the appropriate registry keys and delete the service-files. That would then be a pure KiX solution.
_________________________
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 1283 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 seconds in which 0.027 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