Page 1 of 1 1
Topic Options
#152055 - 2005-11-23 12:29 AM Stopping a service with Kix
Aaron Perrault Offline
Fresh Scripter

Registered: 2003-08-29
Posts: 27
Loc: Emeryville, CA
OK guys, I know that this can be done, but I am having a moment right now. How do I stop a service. We want to make sure that all of our machines re-authenticate to the WSUS server every time they login, just to make sure that nothing gets missed. here is what I have:

If Exist ("%wiwndir%\system32\pskill.exe")
Display ("File Exists")
Else Copy @ldrive+\files\pskill.exe ("%windir%\system32")
;
Run ("%windir%\system32\pskill.exe wauclt")
Sleep 6
net stop "Automatic Updates"
Net Start "Automatic Updates"
Run ("%windir%\system32\wuauclt.exe /resetauthorization /detectnow")

I am having two problems with this code, first, if the wuault program is not running, I get an error, any thoughts on how to just allow it to continue without a response from me? Also, how do I stop then start the WSUS service ("Automatic Updates"). I know that they net stop and net srart work from a batch file, but I dont want to do it that way.

thanks much

app

Top
#152056 - 2005-11-23 01:26 AM Re: Stopping a service with Kix
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
How about a one-liner:

GetObject("WinNT://@WKSTA/Alerter,Service").Stop

-Shawn

Top
#152057 - 2005-11-23 01:27 AM Re: Stopping a service with Kix
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, if you are speaking about stopping a real service, there are ready codes on this board.

guess the simpliest approach would be:
Code:

shell 'net stop "your Service"'



killing the process is not same as stopping the service.
_________________________
!

download KiXnet

Top
#152058 - 2005-11-23 01:28 AM Re: Stopping a service with Kix
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
oh, and RUN is not a function so the parens are superfluous.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#152059 - 2005-11-23 01:31 AM Re: Stopping a service with Kix
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Plus, Windows Update service would be:

GetObject("WinNT://@WKSTA/WUAUSERV,Service").Stop

Top
#152060 - 2005-11-23 01:32 AM Re: Stopping a service with Kix
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
oh, and what is "wauclt"?
I know not of such a service. There is "wUauclt" that runs as a process but it is not a service.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#152061 - 2005-11-23 01:33 AM Re: Stopping a service with Kix
Aaron Perrault Offline
Fresh Scripter

Registered: 2003-08-29
Posts: 27
Loc: Emeryville, CA
Thanks guys,
I will try the shell command. I dont know why I didnt think of that. I will let you know if I have any problems.

Thanks guys, as always, the greatest board on the net.

Now, just if my MSExchange boards were this responsive.

talk to y'all later.

app

Top
#152062 - 2005-11-23 01:35 AM Re: Stopping a service with Kix
Aaron Perrault Offline
Fresh Scripter

Registered: 2003-08-29
Posts: 27
Loc: Emeryville, CA
hey les, i meant the wuauclt process, not a service. If my memory serves me correctly, which I am not sure it does at this point in the day, it is the AutoUpdate process for WSUS.

thanks again.

app

Top
Page 1 of 1 1


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

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.06 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

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