PC Review


Reply
Thread Tools Rate Thread

Batch to start/stop services

 
 
wbyeats74@gmail.com
Guest
Posts: n/a
 
      20th Feb 2009
Hi guys, I'm trying to make a batch file to stop and start multiple
services on my pc.

When I run it I get an error 5 access denied error for each process I
try to start.
Why? I'm admin of my pc and If I try to manually stop it in the
services window I can successfully stop it.
I just cannot when I try to stop them in the batch.
Is there any solution?

Thanks a lot in advance

mario
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      20th Feb 2009

<(E-Mail Removed)> wrote in message
news:8ddb0ecf-26a9-4f52-9b4c-(E-Mail Removed)...
> Hi guys, I'm trying to make a batch file to stop and start multiple
> services on my pc.
>
> When I run it I get an error 5 access denied error for each process I
> try to start.
> Why? I'm admin of my pc and If I try to manually stop it in the
> services window I can successfully stop it.
> I just cannot when I try to stop them in the batch.
> Is there any solution?
>
> Thanks a lot in advance
>
> mario


Let's have a look at your batch file.


 
Reply With Quote
 
wbyeats74@gmail.com
Guest
Posts: n/a
 
      20th Feb 2009
> Let's have a look at your batch file.

Well, that's not really complicated ...

it contains:

net stop "Servicename1"
net stop "Servicename2"
net stop "Servicename3"

That's it.
I've also tested it with just Servicename1 but it doesn't work anyway.

mario




 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      20th Feb 2009

<(E-Mail Removed)> wrote in message
news:63d63419-32b0-4527-97e4-(E-Mail Removed)...
>> Let's have a look at your batch file.

>
> Well, that's not really complicated ...
>
> it contains:
>
> net stop "Servicename1"
> net stop "Servicename2"
> net stop "Servicename3"
>
> That's it.
> I've also tested it with just Servicename1 but it doesn't work anyway.
>
> mario


OK. And what happens when you type the command at a Command Prompt?

net stop w32time{Enter}

(Please note: A "Command Prompt" is NOT the same thing as the Start/Run
box!)


 
Reply With Quote
 
wbyeats74@gmail.com
Guest
Posts: n/a
 
      20th Feb 2009
On Feb 20, 4:54*pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> <wbyeat...@gmail.com> wrote in message
>
> news:63d63419-32b0-4527-97e4-(E-Mail Removed)...
>
> >> Let's have a look at your batch file.

>
> > Well, that's not really complicated ...

>
> > it contains:

>
> > net stop "Servicename1"
> > net stop "Servicename2"
> > net stop "Servicename3"

>
> > That's it.
> > I've also tested it with just Servicename1 but it doesn't work anyway.

>
> > mario

>
> OK. And what happens when you type the command at a Command Prompt?
>
> net stop w32time{Enter}
>
> (Please note: A "Command Prompt" is NOT the same thing as the Start/Run
> box!)


If I try to net stop w32time it works.
But if I try to net stop my service it says Error 5, access denied.
The problem is that I can stop this service via the Services windows
panel, but not via command.

So it's not related to every services, but just this particoular one

mario
 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      20th Feb 2009

<(E-Mail Removed)> wrote in message
news:d2be3e66-43e4-43af-9cba-(E-Mail Removed)...
On Feb 20, 4:54 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> <wbyeat...@gmail.com> wrote in message
>
> news:63d63419-32b0-4527-97e4-(E-Mail Removed)...
>
> >> Let's have a look at your batch file.

>
> > Well, that's not really complicated ...

>
> > it contains:

>
> > net stop "Servicename1"
> > net stop "Servicename2"
> > net stop "Servicename3"

>
> > That's it.
> > I've also tested it with just Servicename1 but it doesn't work anyway.

>
> > mario

>
> OK. And what happens when you type the command at a Command Prompt?
>
> net stop w32time{Enter}
>
> (Please note: A "Command Prompt" is NOT the same thing as the Start/Run
> box!)


If I try to net stop w32time it works.
But if I try to net stop my service it says Error 5, access denied.
The problem is that I can stop this service via the Services windows
panel, but not via command.

So it's not related to every services, but just this particoular one

mario

=============

.. . . and it's not related to batch files either!

I haven't come across this one before. Perhaps sc.exe will do the trick:
sc start w32time
sc stop w32time

I also recommend that you look more closely at the account under the
service's "Log on" tab. In particular you should compare the settings of
your own service with those of the w32time service.


 
Reply With Quote
 
Kelly
Guest
Posts: n/a
 
      21st Feb 2009
The Service Host process may stop unexpectedly in Windows
http://support.microsoft.com/kb/932762

--

All the Best and Happy Mardi Gras,
Kelly (MS-MVP/DTS&XP)

Taskbar Repair Tool Plus!
http://www.kellys-korner-xp.com/taskbarplus!.htm


<(E-Mail Removed)> wrote in message
news:8ddb0ecf-26a9-4f52-9b4c-(E-Mail Removed)...
> Hi guys, I'm trying to make a batch file to stop and start multiple
> services on my pc.
>
> When I run it I get an error 5 access denied error for each process I
> try to start.
> Why? I'm admin of my pc and If I try to manually stop it in the
> services window I can successfully stop it.
> I just cannot when I try to stop them in the batch.
> Is there any solution?
>
> Thanks a lot in advance
>
> mario


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
start services via batch file? MicroFox Windows XP Customization 7 4th Nov 2006 11:05 PM
start services via batch file? MicroFox Windows XP General 7 4th Nov 2006 11:05 PM
start services via batch file? MicroFox Windows XP Help 7 4th Nov 2006 11:05 PM
Batch script to start services with timer donald beck Microsoft Windows 2000 CMD Promt 1 25th Sep 2003 07:13 PM
Start Services from a batch file Rick Price Microsoft Windows 2000 0 15th Aug 2003 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 PM.