Page 1 of 1 1
Topic Options
#119097 - 2004-05-06 09:20 AM Services
clayton74 Offline
Fresh Scripter

Registered: 2003-02-16
Posts: 8
Is there any way of scripting start/stop a service in windows please
Top
#119098 - 2004-05-06 09:40 AM Re: Services
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
there are several,

on local you could SHELL a net stop / net start command
for remote you could SHELL an xnet command (xnet comes with KiXtart)
or you might even do a search on the udf Library forum as there are quite a few Services udf's already written
_________________________



Top
#119099 - 2004-05-06 09:47 AM Re: Services
LarsSchwittay Offline
Lurker

Registered: 2004-05-05
Posts: 4
Hi,
the easy way is to use the net command from a batch file that is call with "run" or "shell" to be executed. The batch should contain a line like this if you want to start for example the Automatic Updates service:
net start wuauserv

or if you want to use the long name instead:

net start "Automatic Updates"

Br
Lars Schwittay

Top
#119100 - 2004-05-06 10:57 AM Re: Services
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
doing it the batch-way is never easy.
_________________________
!

download KiXnet

Top
#119101 - 2004-05-06 02:55 PM Re: Services
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There are several "Services" related UDFs already posted.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#119102 - 2004-05-06 04:00 PM Re: Services
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, no udfs needed either.
just simple shell-line.
_________________________
!

download KiXnet

Top
#119103 - 2004-05-06 04:39 PM Re: Services
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
To stop a service...
Code:
Shell '%comspec% /c net stop servicename'



To Start a service...
Code:
Shell '%comspec% /c net start servicename'


Top
#119104 - 2004-05-06 04:40 PM Re: Services
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
almost there but not quite.
Code:
 Shell 'net stop servicename' 

Code:
 Shell 'net start servicename' 

_________________________
!

download KiXnet

Top
#119105 - 2004-05-06 04:49 PM Re: Services
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You should also be able to do this using WMI too.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#119106 - 2004-05-06 05:43 PM Re: Services
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja, with the lot commercialized UDFs.
but I thought the latter discussion came from comment about easy.
_________________________
!

download KiXnet

Top
#119107 - 2004-05-06 09:39 PM Re: Services
clayton74 Offline
Fresh Scripter

Registered: 2003-02-16
Posts: 8
Sorry thinking to deep, didn't reaalise it was as simple as that. Is there a way of starting services without admin privledges. Thanks to all who replied
Top
#119108 - 2004-05-06 10:03 PM Re: Services
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The short answer is NO, but if you provided more details we might be able to suggest a work-around.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#119109 - 2004-05-07 08:35 AM Re: Services
clayton74 Offline
Fresh Scripter

Registered: 2003-02-16
Posts: 8
I have copied the timeserv program onto our NT client pc's and am looking to start the service timeserv - automatic. Thank you for taking the time to help
Top
#119110 - 2004-05-08 01:26 AM Re: Services
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the starting could be done during the copy.
in admin-script, do your things and finally use xnet (comes with kix) to start and/or install) a service on the client.
this way, the user does not need any rights as it's done as you, probably a workstation admin priviledged user.
_________________________
!

download KiXnet

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
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.194 seconds in which 0.158 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